On Tue, 28 Aug 2012 07:18:03 +0200, you wrote: > > gjohn...@mixnym.net wrote: > > On Sun, 26 Aug 2012 09:52:14 +0200, you wrote: > >> > >> gjohn...@mixnym.net wrote: > >> > >>>> Demo settings: > >>>> smtp.gmail.com:25 > >>>> SslVerifyPeer = unchecked > >>>> SSL type = Explicit(StartSssl) > >>> > >>> Hi Arno, > >>> > >>> I'm sorry to say, I couldn't run the demo in cbuilder 2007. But I > >>> put together a quick demo based on the SslMailSnd project to test > >>> for the problem. It's a very small project _only_ intended to test > >>> for failed handshake--nothing more. > >>> > >>> My demo resulted in the same problem that my program has. It fails > >>> the handshake. Here are my results. > >> > >> Make sure that property TSslContext->SslVersionMethod is set to > >> sslV23_CLIENT and that you use recent SSL libraries from here ( > >> supported version depends on the version of your source code): > >> http://wiki.overbyte.be/wiki/index.php/ICS_Download > > > > Gee, I had hopes for that! But it still fails the handshake. Just as > > a test I set the port to 587 in my little demo and then the handshake > > succeeded. But on port 25, fails. > > If it does work with port 587 it should work with port 25 the same > way since both support the STARTTLS command. > I've no idea why it doesn't work for you?
That's been the mystery for me, Arno! > >> If the handshake still fails drop a TIcsLogger onto the form, > >> tick all options and log the failure, post the log to this > >> list. > > > > Well, I didn't get much: > > > > 12:51:02:198 InitCtx> OpenSSL version: OpenSSL 1.0.0d 8 Feb 2011 > > > > That's it. > > Sorry for my bad advise. The TSslContext has a published property > IcsLogger, simply assign it in object inspector. Also assign > TSslSmtpClient->CtrlSocket->IcsLogger the same IcsLogger instance at > runtime. I was aware I needed to assign the logger to the sslcontext, but not the ctrlsocket. When I added it to the CtrlSocket, I got a lot more: 01:58:28:984 022C2400 Socket handle created 556 01:58:28:984 TWSocket will connect to 173.194.69.108:25 01:58:29:176 022C2400 TryToSend 556 01:58:29:176 022C2400 TriggerDataSent 556 01:58:29:370 022C2400 PutDataInSendBuffer 556 len 15 [1] 01:58:29:370 022C2400 TryToSend 556 01:58:29:370 022C2400 TryToSend 556 01:58:29:370 022C2400 TriggerDataSent 556 01:58:29:567 022C2400 PutDataInSendBuffer 556 len 10 [2] 01:58:29:567 022C2400 TryToSend 556 01:58:29:567 022C2400 TryToSend 556 01:58:29:567 022C2400 TriggerDataSent 556 01:58:29:761 022C2400 StartSslHandshake 556 01:58:29:764 InitCtx> OpenSSL version: OpenSSL 1.0.0d 8 Feb 2011 01:58:30:253 022C2400 InitSSLConnection 556 01:58:30:253 022C2400 BIO_ctrl(sslbio, BIO_C_SET_SSL, BIO_NOCLOSE, 0x36C6E90) = 1 [3] 01:58:30:253 022C2400 ICB> SSL_CB_HANDSHAKE_START 01:58:30:253 022C2400 ICB> SSL_connect: before/connect initialization 01:58:30:253 022C2400 ICB> SSL_connect: SSLv2/v3 write client hello A 01:58:30:253 022C2400 ICB> SSL_connect: error in SSLv2/v3 read server hello A 01:58:30:253 022C2400 BIO_read(sslbio, 0x17D42B, 0) = -1 [4] 01:58:30:253 022C2400 BIO_should_retry(sslbio) = 1 [5] 01:58:30:253 022C2400 TriggerEvent sslFdRead 556 01:58:30:253 022C2400 TriggerEvent sslFdWrite 556 01:58:30:253 022C2400 SslAsyncSelect 556, 1 FD_READ 01:58:30:253 022C2400 TCustomSslWSocket.Do_FD_READ 556 01:58:30:253 022C2400 BIO_ctrl_get_read_request(nbio) = 7 [6] 01:58:30:253 022C2400 Winsock recv( 556, 0x17DC63, 7, 0) = -1 [7] 01:58:30:253 022C2400 TriggerEvents 556 SslState: SSL_ST_INIT // MayFD_Read=0 MayDoRecv=-1 MayFD_Write=-1 MaySslTryToSend=-1 bSslAllSent=0 bAllSent=-1 01:58:30:253 022C2400 BIO_ctrl_pending(nbio) = 214 [8] 01:58:30:253 022C2400 BIO_ctrl_get_write_guarantee(nbio) = 4096 [9] 01:58:30:253 022C2400 SslAsyncSelect 556, 2 FD_WRITE 01:58:30:253 022C2400 TCustomSslWSocket.Do_FD_WRITE 556 01:58:30:253 022C2400 BIO_ctrl_pending(nbio) = 214 [10] 01:58:30:254 022C2400 BIO_read(nbio, 0x17BC84, 214) = 214 [11] 01:58:30:254 022C2400 my_RealSend (0x22C, 1555588, 214) = 214 [12] 01:58:30:254 022C2400 BIO_ctrl_pending(nbio) = 0 [13] 01:58:30:254 022C2400 TriggerEvents 556 SslState: SSL_ST_INIT // MayFD_Read=0 MayDoRecv=-1 MayFD_Write=-1 MaySslTryToSend=-1 bSslAllSent=0 bAllSent=-1 01:58:30:254 022C2400 BIO_ctrl_pending(nbio) = 0 [14] 01:58:30:254 022C2400 BIO_ctrl_get_write_guarantee(nbio) = 4096 [15] 01:58:30:254 022C2400 TCustomSslWSocket.Do_FD_WRITE 556 01:58:30:254 022C2400 BIO_ctrl_pending(nbio) = 0 [16] 01:58:30:254 022C2400 BIO_read(nbio, 0x17BC6C, 0) = 0 [17] 01:58:30:254 022C2400 TriggerEvents 556 SslState: SSL_ST_INIT // MayFD_Read=0 MayDoRecv=-1 MayFD_Write=-1 MaySslTryToSend=-1 bSslAllSent=0 bAllSent=-1 01:58:30:254 022C2400 BIO_ctrl_pending(nbio) = 0 [18] 01:58:30:254 022C2400 BIO_ctrl_get_write_guarantee(nbio) = 4096 [19] 01:58:30:254 022C2400 TCustomSslWSocket.Do_FD_WRITE 556 01:58:30:254 022C2400 BIO_ctrl_pending(nbio) = 0 [20] 01:58:30:254 022C2400 BIO_read(nbio, 0x17BC6C, 0) = 0 [21] 01:58:30:254 022C2400 TriggerEvents 556 SslState: SSL_ST_INIT // MayFD_Read=0 MayDoRecv=-1 MayFD_Write=-1 MaySslTryToSend=-1 bSslAllSent=0 bAllSent=-1 01:58:30:254 022C2400 BIO_ctrl_pending(nbio) = 0 [22] 01:58:30:254 022C2400 BIO_ctrl_get_write_guarantee(nbio) = 4096 [23] 02:08:29:657 022C2400 TCustomSslWSocket.Do_FD_CLOSE error #0 556 02:08:29:657 022C2400 *CloseCalled 556 02:08:29:657 022C2400 Socket data pending: 0 Err: 0 556 02:08:29:657 022C2400 SslHandshakeDone(1) 556. Secure connection with Unknown, cipher Unknown, 0 secret bits (0 total), session reused=False 02:08:29:659 022C2400 ResetSslSession 556 02:08:29:660 022C2400 FCloseInvoked=0 -1 Thanks so much, George -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be