Prasad, Comments inline: On 11 Dec 2011, at 19:06, Prasad Khurd wrote:
socketStreamOn: socket | stream sss | stream := ZdcSecureSocketStream on: socket. stream binary; shouldSignal: true; autoFlush: false; bufferSize: self class socketBufferSize;
The 4 messages above are not necessary (they are no-ops for ZdcSecureSocketStream, see their implementation).
timeout: self class socketStreamTimeout. stream sslSession certificateName: '/home/khurd/pharo/cert.pem'.
sss := stream sslSession. Transcript cr; show: 'Is connected: ', sss isConnected printString, 'certVerifState: ', sss certificateVerificationState printString. stream accept.
At the transcript output i get Is connected: false certVerifState: 0 which leads me to believe the certificate (cert.pem) is valid but the sslSession has disconnected
The SSL session can only be OK *after* the #accept.
and i get a walkback in accept stating the connection is closed. Are any of the stream settings wrong? Can u please share briefly how i could debug hereâ¦
What is the walkback ?
Also do i need to set the certificateName on the client stream's sslSession?
ss := ZdcSecureSocketStream openConnectionToHostNamed: 'localhost' port: 443. ss sslSession certificateName: '/home/khurd/pharo/cacert.pem'.
Each secure stream has an SSLSession instance on which you should set the certificate once. The argument should be the full path to the .pem file which must include both the certificate and the private key. In the document that you used I think it should be key-cert.pem, the combined private key and certificate. Good luck and be sure to let me know how it goes. Sven PS: BTW I guess you are on Linux ? Because on Mac OS X this won't work due to missing functionality in the plugin.