Posting using ssl

Hi anybody,

I've successful working a program on unix using libwww to post data and
storing the result to a memory buffert using http protocol.

However, when I use the ssl the program verify correctly the server
certificate, but it don't produce result on the memory buffer.  (I've
successful working the example wwwssl, but this use LoadToFile and not
HTPostAnchor(src,dst,request) ).

The basic changes only are the insertion of these functios:

                ............
 // Create a new no-premptive client
  HTProfile_newNoCacheClient(APP_NAME, APP_VERSION);

// these are added
 HTSSL_protMethod_set (HTSSL_V23);
 HTSSL_verifyDepth_set (2);
 HTSSLhttps_init(YES);

     ...............

request = HTRequest_new();
dst = HTAnchor_findAddress(url);
src = HTTmpAnchor(NULL);
HTAnchor_setDocument(src, data);
HTAnchor_setFormat(src, HTAtom_for(pass_as));
HTAnchor_setLength(src, data_size);
HTRequest_setOutputFormat(request, WWW_SOURCE);
target = HTStreamToChunk(request, &chunk, 0);
HTRequest_setAnchor(request, dst);
HTRequest_setOutputStream(request, target);
HTNet_addAfter(terminate_post, NULL, NULL, HT_ALL, HT_FILTER_LAST);
HTXMLCallback_registerNew (HTXML_newInstance, NULL);
if (HTPostAnchor(src,dst,request)==YES)
      // enter the event loop waiting until it terminates
      HTEventList_loop(request);
    else
{
      HTNet_deleteAfter(terminate_post);
      HTRequest_delete(request);
      HTSSLhttps_terminate();
      return ERROR;
}

if (status==SUCCESS)
    {
      // transfer back the memory buffer
      *response = HTChunk_toCString(chunk);
      chunk     = NULL;
}
else if (chunk)
{
      HTChunk_delete(chunk);
      chunk = NULL;
}



This is the trace:

HTSSLContext Created context 162b88HTAccess.... Accessing document
https://www.bancochile.cl
Credentials. verified
HTTP........ Looking for `https://www.bancochile.cl'
HTHost parse Looking up `www.bancochile.cl' on port 443
HTHost 160c78 going to state TCP_CHANNEL.
HTHost 160c78 going to state TCP_DNS.
DNS Add..... `www.bancochile.cl' with 1 home(s) to 169000
HTHost 160c78 going to state TCP_NEED_SOCKET.
Socket...... Created 4
Socket...... Turned off Nagle's algorithm
Socket...... Blocking socket
Channel..... Hash value is 4
Channel..... Added 15e650 to list 169180
HTHost 160c78 going to state TCP_NEED_CONNECT.
HTHost 160c78 going to state TCP_CONNECTED.
HTHost 160c78 connected.
HTTP........ Force flush on preemptive load
HTTP........ Dumping response to `w3chttp.out'
HTTP........ Dumping request to `w3chttp.out'
HTTP........ Generating HTTP/1.x Request Headers
HTTP........ Generating General Headers
MIME........ Generating Entity Headers
HTSSL New... Created new SSL Object 16c698
HTSSL....... Setting up 16c698 on socket 4
HTSSL....... New reference count = 1
SSL_connect: before/connect initialization
SSL_connect: SSLv2/v3 write client hello A
SSL_connect: SSLv3 read server hello A
depth = 1 /C=US/O=RSA Data Security, Inc./OU=Secure Server Certification
Authority
verify return: 1
depth = 0 /C=CL/ST=Santiago/L=Santiago de Chile/O=Banco de
Chile/OU=Informatica/OU=Terms of use at www.verisign.com/rpa
(c)00/CN=www.bancochile.cl
verify return: 1
SSL_connect: SSLv3 read server certificate A
SSL_connect: SSLv3 read server done A
SSL_connect: SSLv3 write client key exchange A
SSL_connect: SSLv3 write change cipher spec A
SSL_connect: SSLv3 write finished A
SSL_connect: SSLv3 flush data
SSL_connect: SSLv3 read finished A
Uploading... Holding 15ca90 for 2000 ms using time 185728
HTSSL New... Found SSL 16c698 with sd =  4
HTSSL....... New reference count = 2
Host info... New mode is 1 for host 160c78
Host........ 98 bytes remaining
Host........ 0 bytes remaining
SSL3 alert read:warning:close notify
HTSSLReader. FIN received on socket 4
HTSSL....... Closing SSL Object 16c698
HTSSL Free.. ref_count = 1
HTTP Clean.. Called with status -500, net 160c18
Channel..... Semaphore set to 0 for channel 15e650
Channel..... Delete 15e650 with semaphore 0, status -500
Channel..... Delete input stream 16cc08 from channel 15e650
HTSSLReader. Free 16cc08
MIME........ FREEING....
Channel..... Delete input stream 16cc08 from channel 15e650
HTSSL Free.. ref_count = 0
HTSSL.Free.. FINAL RELEASE
Channel..... Deleted 15e650, socket 4
Load End.... Request ended with code -500



   Well if anybody have or resolv this problem please can I help me.

Bye all.

Received on Friday, 23 March 2001 14:18:45 UTC