Forum OpenACS Q&A: Using ns_register_proc with SSL (i.e. ns_httpspost)

I've set up a proc using ns_register_proc to handle incoming POST requests on a particular proc. I've got this working fine and tested it by POSTing to the url with util_httppost.

However I would actually like the URL to be a secure one i.e. an https url.

Therefore, basically I tested this by using ns_httpspost to post the request to the secure version of the url i.e.

set qsset [ns_set new qsset]
ns_set put $qsset test1 1
ns_set put $qsset test2 2
set response [ns_httpspost "https://www.mysite.com:8445/myurl/theposturl/" "" $qset]

however when I do so I get an error like:

error reading "openssl15": Unknown error 1090389044
    while executing
"read $sock 1"
    (procedure "_ns_https_gets" line 8)
    invoked from within
"_ns_https_gets $timeout $rfd"
    invoked from within
"ns_httpsopen POST $url $rqset $timeout $querystring"
    (procedure "ns_httpspost" line 124)
    invoked from within
"ns_httpspost "https://www.mysite.com:8445/myurl/theposturl/" "" $qsset"
    invoked from within

--
This may well be my ignorance regarding https, but a) is it possible to use ns_register_proc to capture post requests via secure sockets and b) if not what is the correct approach.

Also, if this helps, the proc i've registered is also registered to handle GET requests. When I visit the url using the non-secure url i.e. http://www.mysite.com:8080/myurl/theposturl. It calls my proc and displays the page.
However when I change the URL to https://www.mysite.com:8445/myurl/theposturl. I simply get 'file not found'. I assume this means that for some reason the ns_register_proc (which simply accepts /myurl/theposturl/ as url to register against) assumes the secure version is a different url. Do I therefore need to specify the secure url as well, and if so how.

Any suggestions very gratefully received.

Simon

Collapse
Posted by Simon at TCB on
apologies.. slight red herring... the GET method does appear to be working. i.e. just visiting the URL against which the proc has been registered.

Therefore I guess its some subtlety of using ns_httpspost..

any ideas?

Collapse
Posted by Simon at TCB on
I'm also doing the post from the same server thats receiving it, in case that's significant.