Hi All, 
I am trying to connect to a SSL server from behind proxy and using the
following code.


SS_library_init();
SSL_load_error_strings();
BIO*Socket= BIO_new_connect(“proxy::port”);
If(BIO_do_connect(Socket))
{
            Char*Data  = “CONNECT abc.com:80 HTTP/1.0\r\n\r\n”;
            BytesSent = BIO_write(Socket,Data,strlen(Data));
            If(BytesSent>0) 
            {
                        // if I try to get the response from proxy next , I
receive 0 bytes from proxy, I am not sure whether I would get any response
of my commands or not
                        // so I continued converting it to ssl connection
                        
                        //initializing SSL socket and setting SSL connection
options. 
                        
       SSL_CTX*ctx = SSL_ctx_new(sslv23_method());
                        SSL_CTX_set_verify(ctx,SSL_VERIFY_NONE,verify_cb);
                        SSL_CTX_set_timeout(ctx,timeout); 
                        SSL_CTX_set_cipherlist(ctx,CIPHERLIST);
                        SSL*sslSocket = SSL_new(ctx);
                        
       //setting the bio to ssl socket
       
       SSL_set_bio(sslSocket,Socket,Socket);
                        If(SSL_connect(sslSocket))
                   {
       …..ssl connection established
       }
       //but I get error here with no description lib(0) :status(0)  
       } 
}

I don’t know whether I am not following the right procedure or there is
something to do with proxy blocking what ever it is I am unable to receive
response from the proxy.


Reply via email to