> Let me understand this correctly: In your next version, I'll be able to
> ns_httpget (or some equivalent) an SSL site?  I'm looking for this
> functionality *right now*.  Is something like this availible now in
> AOLServer/TCL, or is yours the first?

Yes, Sort of, Maybe.

I'm implementing all of the equivalnent ns_sock* Tcl commands in nsopenssl,
include a C API. As of this moment I can make outgoing SSL connections and
fetch pages. I've implemented ns_httpsget and ns_httpsopen by copying and
modifying http.tcl to https.tcl. I've implemented Ns_FetchURL and
ns_geturl. ns_socklisten, is (mostly) working right now.

As far as I know this is the first real capability to do SSL from within
AOLserver; other methods rely on CGI but will work to fetch pages.


Here's an example Tcl script that fetches a page:

        set fds [ns_openssl_sockopen 192.168.0.2 8001]
        set rid [lindex $fds 0]
        set wid [lindex $fds 1]
        puts $wid "GET / HTTP/1.0\r\n\r\n"
        flush $wid
        while {[set line [string trim [gets $rid]]] != ""} {
            lappend headers $line
        }
        set page [read $rid]
        close $rid
        close $wid
        ns_log notice "PAGE=$page"


Here's another:

    set hlist [ns_httpsopen GET "https://192.168.0.2:8001";]
    set rid [lindex $hlist 0]
    set wid [lindex $hlist 1]
    set setid [lindex $hlist 2]
    ns_log notice "RID=$rid  WID=$wid  SETID=$setid"
    set page [read $rid]
    close $rid
    close $wid
    ns_log notice "PAGE=$page"

And another:

    set page [ns_httpsget "https://192.168.0.2:8001";]
    ns_log notice "PAGE=$page"


The software is in beta right now. Expected release is as soon after next
weekend as possible.


/s.

Reply via email to