[twsocket] Error updating to last revision
Hello I'm trying to update ICS component to latest revision and get errors when building design time component (no problems with run time component). Restoring my old revision (1 year old) I can build again both components, I'm getting authentication problems when sending email using outlook365 servers (at this moment gmail ist's working fine). I checked configuration (server, user, password,...) with Thunderbird and all works fine. Thanks in advance. Xavi List of errors I'm getting (RAD Studio 2009) [ILINK32 Error] Error: Unresolved external 'CertFreeCertificateChainEngine' referenced from C:\USERS\XAVI\DOCUMENTS\BC\COMPONENTS\ICS\LIB\DEBUG\WIN32\D2009\OVERBYTEICSMSSSLUTILS.OBJ [ILINK32 Error] Error: Unresolved external 'CertFreeCertificateContext' referenced from C:\USERS\XAVI\DOCUMENTS\BC\COMPONENTS\ICS\LIB\DEBUG\WIN32\D2009\OVERBYTEICSMSSSLUTILS.OBJ [ILINK32 Error] Error: Unresolved external 'CertCloseStore' referenced from C:\USERS\XAVI\DOCUMENTS\BC\COMPONENTS\ICS\LIB\DEBUG\WIN32\D2009\OVERBYTEICSMSSSLUTILS.OBJ [ILINK32 Error] Error: Unresolved external 'CertOpenSystemStoreW' referenced from C:\USERS\XAVI\DOCUMENTS\BC\COMPONENTS\ICS\LIB\DEBUG\WIN32\D2009\OVERBYTEICSMSSSLUTILS.OBJ [ILINK32 Error] Error: Unresolved external 'CertCreateCertificateChainEngine' referenced from C:\USERS\XAVI\DOCUMENTS\BC\COMPONENTS\ICS\LIB\DEBUG\WIN32\D2009\OVERBYTEICSMSSSLUTILS.OBJ [ILINK32 Error] Error: Unresolved external 'CertOpenStore' referenced from C:\USERS\XAVI\DOCUMENTS\BC\COMPONENTS\ICS\LIB\DEBUG\WIN32\D2009\OVERBYTEICSMSSSLUTILS.OBJ [ILINK32 Error] Error: Unresolved external 'CertFindCertificateInStore' referenced from C:\USERS\XAVI\DOCUMENTS\BC\COMPONENTS\ICS\LIB\DEBUG\WIN32\D2009\OVERBYTEICSMSSSLUTILS.OBJ [ILINK32 Error] Error: Unresolved external 'CertAddCertificateContextToStore' referenced from C:\USERS\XAVI\DOCUMENTS\BC\COMPONENTS\ICS\LIB\DEBUG\WIN32\D2009\OVERBYTEICSMSSSLUTILS.OBJ [ILINK32 Error] Error: Unresolved external 'CertCreateCertificateContext' referenced from C:\USERS\XAVI\DOCUMENTS\BC\COMPONENTS\ICS\LIB\DEBUG\WIN32\D2009\OVERBYTEICSMSSSLUTILS.OBJ [ILINK32 Error] Error: Unresolved external 'CertGetCertificateChain' referenced from C:\USERS\XAVI\DOCUMENTS\BC\COMPONENTS\ICS\LIB\DEBUG\WIN32\D2009\OVERBYTEICSMSSSLUTILS.OBJ [ILINK32 Error] Error: Unresolved external 'CertFreeCertificateChain' referenced from C:\USERS\XAVI\DOCUMENTS\BC\COMPONENTS\ICS\LIB\DEBUG\WIN32\D2009\OVERBYTEICSMSSSLUTILS.OBJ [ILINK32 Error] Error: Unresolved external 'CryptUIDlgViewCertificateW' referenced from C:\USERS\XAVI\DOCUMENTS\BC\COMPONENTS\ICS\LIB\DEBUG\WIN32\D2009\OVERBYTEICSMSSSLUTILS.OBJ -- Xavier Mor-Mur --- El software de antivirus Avast ha analizado este correo electrónico en busca de virus. https://www.avast.com/antivirus -- 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
Re: [twsocket] Body not send on https post
Hi RTT Your suggestion has worked perfectly. Thank you so much. Xavi El 15/08/2017 a les 2:06, RTT ha escrit: Surely is there something wrong but I can't figure were is. Try specifying the data content type AnsiString asPost; asPost = PostMemo->Text; SslHttpCli1->SendStream = new TStringStream(asPost); SslHttpCli1->SendStream->Seek(0,soFromBeginning); SslHttpCli1->ContentTypePost='application/json'; SslHttpCli1->PostASync(); -- Xavier Mor-Mur --- El software de antivirus Avast ha analizado este correo electrónico en busca de virus. https://www.avast.com/antivirus -- 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
Re: [twsocket] Body not send on https post
Hi RTT, et al, for previous tips. I assigned text to body but not reset position to start. I modified code but still having same result. I'm playing with OverbyteIcsHttpsTst sample and button "Post" with next code: void __fastcall THttpTestForm::PostButtonClick(TObject *Sender) { try { PrepareConnection(); Display("Connecting..."); PostButton->Enabled = FALSE; DocumentMemo->Clear(); SslHttpCli1->SendStream = new TStringStream(); // AnsiString asPost; // asPost = PostMemo->Text; // SslHttpCli1->SendStream->WriteBuffer(&asPost, asPost.Length()); // SslHttpCli1->SendStream->Seek(soFromBeginning, 0); WideString ws; ws = PostMemo->Text; SslHttpCli1->SendStream->WriteBuffer(&ws, ws.Length()); SslHttpCli1->SendStream->Position = 0; SslHttpCli1->PostASync(); } catch (Exception& E) { Display("Connect error. " + E.ClassName() + ": " + E.Message); return; } } You can see I tried to assign body in two ways, using a AnsiString or a WideString, but always I get the same result from https server : body is empty. The body I need to send is like next line: {"email":"acco...@domain.com","tipo":"A"} I take a look debug file but, sincerely, I don't understand de sequence and I can't see there the text I want to send. Surely is there something wrong but I can't figure were is. I appreciate any tip about it. Thanks in advance. Xavi El 10/08/2017 a les 22:32, RTT ha escrit: I get error "Body is empty". Is this a ICS error message?! I can't find such message in the ICS code. AnsiString asPost; asPost = PostMemo->Text; SslHttpCli1->SendStream->WriteBuffer(&asPost, asPost.Length()); What kind of stream have you assigned to the SendStream property? Don't forget to reset the SendStream position before the request. The component sends from the stream position. SslHttpCli1.SendStream.seek(0,soFromBeginning); -- Xavier Mor-Mur --- El software de antivirus Avast ha analizado este correo electrónico en busca de virus. https://www.avast.com/antivirus -- 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
[twsocket] Body not send on https post
Hello, I still having problems trying to retrieve data from https server using POST. I get error "Body is empty". I can't find where is the error. I tried use this two ways: AnsiString asPost; asPost = PostMemo->Text; SslHttpCli1->SendStream->WriteBuffer(&asPost, asPost.Length()); WideString ws; ws = PostMemo->Text; SslHttpCli1->SendStream->WriteBuffer(&ws, ws.Length()); I would appreciate any tip on it. Thanks in advance -- Xavier Mor-Mur --- El software de antivirus Avast ha analizado este correo electrónico en busca de virus. https://www.avast.com/antivirus -- 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
Re: [twsocket] Need some help on TSslHttpCli Post
RTT That worked perfect. Thanks El 08/08/2017 a les 0:39, RTT ha escrit: On 07/08/2017 19:53, Xavier Mor-Mur wrote: Hi all I need send a request using http post to get some data from an https server. I know url and body to post, and additional data which identify session that should be included in the head (as instructions say). Problem is I can't identify the property where to set this data. I would appreciate any help. Thanks in advance Using the OnBeforeHeaderSend event: procedure TMyHttpsCli.OnBeforeHeaderSend(Sender: TObject; const Method: string; Headers: TStrings); begin Headers.add('YourDataProperty: YourDataValue'); end; -- Xavier Mor-Mur --- El software de antivirus Avast ha analizado este correo electrónico en busca de virus. https://www.avast.com/antivirus -- 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
[twsocket] Need some help on TSslHttpCli Post
Hi all I need send a request using http post to get some data from an https server. I know url and body to post, and additional data which identify session that should be included in the head (as instructions say). Problem is I can't identify the property where to set this data. I would appreciate any help. Thanks in advance -- Xavier Mor-Mur --- El software de antivirus Avast ha analizado este correo electrónico en busca de virus. https://www.avast.com/antivirus -- 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
Re: [twsocket] Need help on smtp with office365 server
Hello Angus Many thanks for your tips. I found problem where on the configuration of SslContext. I don't remember when I set SslVersionMethod to "SslV23", I changed it to "SslBestVer" and the problem has disappeared. Many thanks to all Xavi El 06/05/2016 a les 9:37, Angus Robertson - Magenta Systems Ltd ha escrit: Recently a client has migrated all email accounts to send mail using office365 server. Now my programs can't send email using that server. Always get "Error=535 5.7.3 Authentication unsuccessful" I tried many options but always get error 553. The limited information in the log appears to show the server connects correctly with SSL, with authentication fails, which is most likely a bad login or password. The AUTH command has worked for many years, unlikely to be a problem with it. Exactly which version of ICS are you using? Anything related to SSL really needs the latest versions of everything since it changes so often. ICS will send email using Microsoft hotmail.com, live.com, outlook.com, although this appears to be more modern server than office365.com since it also supports XOAUTH2 (which we don't). < 220 BLU436-SMTP187.smtp.hotmail.com Microsoft ESMTP MAIL Service, Version: 8.0.9200.16384 ready at Fri, 6 May 2016 00:26:27 -0700 08:26:28 - SMTP Session Connected to 65.55.176.126:25 EHLO PC20 < 250-BLU436-SMTP187.smtp.hotmail.com Hello [82.33.197.157] < 250-TURN < 250-SIZE 41943040 < 250-ETRN < 250-PIPELINING < 250-DSN < 250-ENHANCEDSTATUSCODES < 250-8bitmime < 250-BINARYMIME < 250-CHUNKING < 250-VRFY < 250-TLS < 250-STARTTLS < 250 OK STARTTLS < 220 2.0.0 SMTP server ready Starting SSL handshake 08:26:28 - smtp.live.com 3 SSL Certificates in the verify chain: Depth #1 Verify Result: No error found for this certificate. Issued to: *.hotmail.com, Microsoft Corporation Alt Domains: *.hotmail.com, *.live.com, *.outlook.com, hotmail.com Issuer: GlobalSign Organization Validation CA - SHA256 - G2, GlobalSign nv-sa Expires: 15/12/2016, Signature: sha256WithRSAEncryption Public Key: rsaEncryption 2048 bits Depth #2 Verify Result: No error found for this certificate. Issued to: GlobalSign Organization Validation CA - SHA256 - G2, GlobalSign nv-sa Issuer: GlobalSign Root CA, GlobalSign nv-sa Expires: 20/02/2024, Signature: sha256WithRSAEncryption Public Key: rsaEncryption 2048 bits Depth #3 Verify Result: No error found for this certificate. Issued to: GlobalSign Root CA, GlobalSign nv-sa Issuer: Self Signed Expires: 28/01/2028, Signature: sha1WithRSAEncryption Public Key: rsaEncryption 2048 bits SSL Connected OK with TLSv1.2, cipher ECDHE-RSA-AES256-SHA384, key exchange ECDH, encryption AES(256), message authentication SHA384 EHLO PC20 08:26:28 - New SSL Session < 250-BLU436-SMTP187.smtp.hotmail.com Hello [82.33.197.157] < 250-TURN < 250-SIZE 41943040 < 250-ETRN < 250-PIPELINING < 250-DSN < 250-ENHANCEDSTATUSCODES < 250-8bitmime < 250-BINARYMIME < 250-CHUNKING < 250-VRFY < 250-AUTH LOGIN PLAIN XOAUTH2 < 250 OK AUTH LOGIN < 334 xXNlxm5xbWx6 bWFnx3lzQxxpdmUxY29t < 334 Uxxzcxdxcmx6 cxdxcxRxNw== < 235 2.7.0 Authentication succeeded Angus -- Xavier Mor-Mur -- 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
[twsocket] Need help on smtp with office365 server
Hello Recently a client has migrated all email accounts to send mail using office365 server. Now my programs can't send email using that server. Always get "Error=535 5.7.3 Authentication unsuccessful" I tried many options but always get error 553. < 250-DB5PR04CA0024.outlook.office365.com Hello [2.139.151.187] < 250-SIZE 157286400 < 250-PIPELINING < 250-DSN < 250-ENHANCEDSTATUSCODES < 250-STARTTLS < 250-8BITMIME < 250-BINARYMIME < 250 CHUNKING > STARTTLS < 220 2.0.0 SMTP server ready Starting SSL handshake > ...[DataBlock of 132 chars]... smtpStartTlsRequestDone Rq=12 Error=0 > EHLO XAVIW8 < 250-DB5PR04CA0024.outlook.office365.com Hello [2.139.151.187] < 250-SIZE 157286400 < 250-PIPELINING < 250-DSN < 250-ENHANCEDSTATUSCODES < 250-AUTH LOGIN < 250-8BITMIME < 250-BINARYMIME < 250 CHUNKING smtpEhloRequestDone Rq=10 Error=0 > AUTH LOGIN < 334 VXNlcm5hbWU6 > ZXVyb211c19tYmFAbXVzZW9iaWxiYW8uY29t < 334 UGFzc3dvcmQ6 > RGFwbzkzOTA= < 535 5.7.3 Authentication unsuccessful smtpAuthRequestDone Rq=11 Error=535 5.7.3 Authentication unsuccessful I configured Outlook and Thunderbird with supplied parameters with no problem. On that programs can set secure mode to TLS or SSL, but only works TLS. I don't find how to configure ICS to work with TLS. I would agree any help about it. Thanks in advance Xavi -- 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
Re: [twsocket] OpenSSL update distributor
That was I supposed the way ICS procedure. But what happens when ICS is also in a DLL? When application starts working directory contains application and my personal dll's. The problem came at the moment I need to use the dll with ICS component, because working directory may have changed. Will need to find the most safe way to restore working directory to application one. There is a way to detect the directory from which was loaded dll when that was done by windows? Xavi El 16/07/2015 a les 8:59, Angus Robertson - Magenta Systems Ltd ha escrit: There is any way to tell ICS where to search and load OpenSSL DLLs to prevent load incompatible version? ICS tries to load the OpenSSL DLLs from the same directory as the application, if they are not found there it tries the system path. At this moment I copy these DLLs to system32 or syswow64 and I not detected any problems on other programs. I've never seen an application install OpenSSL into these directories, not a good idea. Due to the numerous versions of OpenSSL and numerous applications that use it, the only safe solution is to put the DLLs in the same directory as the application, It is always a good idea to test and log the actual OpenSSL version when your application starts, to avoid problems later. try MailSslContext.InitContext ; // initialises GLIBEAY_DLL_FileName if NOT FileExists (GLIBEAY_DLL_FileName) then DispInfoLog ('SSL/TLS DLL Not Found: ' + GLIBEAY_DLL_FileName) else DispInfoLog ('SSL/TLS DLL: ' + GLIBEAY_DLL_FileName + ', Version: ' + OpenSslVersion) ; except DispInfoLog ('Failed to Initialse SSL/TLS - ' + GetExceptMess (ExceptObject)) ; end; Angus -- Xavier Mor-Mur -- 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
Re: [twsocket] Need help on https
Many thanks RTT I will play with your suggestions on both post. Xavi El 16/07/2015 a les 11:05, RTT ha escrit: On 15-Jul-2015 20:34, Xavier Mor-Mur wrote: I tried also with application/json but get same error too. I take a look on debug files changing only the content type and basically differ on the end where next lines don't exist when application/json Have you tried this login procedure from a different client (e.g. with javascript from a web browser)? The problem is, most of the times, data related (i.e. wrong data or not properly encoded), not protocol related. -- Xavier Mor-Mur -- 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
Re: [twsocket] OpenSSL update distributor
El 15/07/2015 a les 20:32, Angus Robertson - Magenta Systems Ltd ha escrit: So generally you can not just copy newer OpenSSL DLLs over old ones and expect it to still work. But this tool is useful for developers that distribute OpenSSL DLLs as part of their applications, keeping them all up to date. I normally have to copy new DLLs into about 20 directories, this tool will save me the trouble. Angus There is any way to tell ICS where to search and load OpenSSL DLLs to prevent load incompatible version? At this moment I copy these DLLs to system32 or syswow64 and I not detected any problems on other programs. I think any moment they may be replaced with a wrong version. -- Xavier Mor-Mur -- 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
Re: [twsocket] Need help on https
I tried also with application/json but get same error too. I take a look on debug files changing only the content type and basically differ on the end where next lines don't exist when application/json 21:45:34:394 022A4070 TCustomSslWSocket.Do_FD_CLOSE error #0 592 21:45:34:396 022A4070 *CloseCalled 592 21:45:34:397 022A4070 BIO_ctrl_pending(sslbio) = 0 [154] 21:45:34:400 022A4070 Socket data pending: 0 Err: 0 592 21:45:34:402 022A4070 SslInternalShutdown 592 21:45:34:404 022A4070 ICB> SSL3 alert write warning close notify 21:45:34:405 022A4070 BIO_ctrl_pending(nbio) = 27 [155] 21:45:34:407 022A4070 SslShutdownCompleted *0* 592 21:45:34:409 022A4070 TriggerEvents 592 SslState: SSL_ST_OK // MayFD_Read=0 MayDoRecv=-1 MayFD_Write=-1 MaySslTryToSend=-1 bSslAllSent=-1 bAllSent=-1 21:45:34:410 022A4070 BIO_ctrl_pending(nbio) = 27 [156] 21:45:34:412 022A4070 TriggerEvent sslFdWrite 592 21:45:34:414 022A4070 BIO_ctrl_pending(sslbio) = 0 [157] 21:45:34:415 022A4070 BIO_ctrl_get_write_guarantee(nbio) = 4096 [158] 21:45:34:417 022A4070 SslAsyncSelect 592, 2 FD_WRITE 21:45:34:419 022A4070 TCustomSslWSocket.Do_FD_WRITE 592 21:45:34:421 022A4070 BIO_ctrl_pending(nbio) = 27 [159] 21:45:34:423 022A4070 BIO_read(nbio, 0x18BC88, 27) = 27 [160] 21:45:34:425 022A4070 my_RealSend (0x250, 1621128, 27) = 27 [161] 21:45:34:426 022A4070 BIO_ctrl_pending(nbio) = 0 [162] 21:45:34:428 022A4070 BIO_ctrl_pending(nbio) = 0 [163] 21:45:34:429 022A4070 BIO_ctrl_pending(nbio) = 0 [164] 21:45:34:430 022A4070 TriggerSslShutDownComplete(0) 592 21:45:34:432 022A4070 TCustomWSocket.Shutdown 1 592 21:45:34:433 022A4070 TriggerEvent sslFdClose 592 21:45:34:435 022A4070 SslShutdownCompleted *1* 592 21:45:34:436 022A4070 SslAsyncSelect 592, 32 FD_CLOSE 21:45:34:437 022A4070 TCustomSslWSocket.Do_FD_CLOSE error #0 592 21:45:34:439 022A4070 BIO_ctrl_pending(sslbio) = 0 [165] 21:45:34:441 022A4070 Socket data pending: 0 Err: 0 592 21:45:34:442 022A4070 FCloseInvoked=0 592 21:45:34:444 SessionClosed Error: 0 21:45:34:446 022A4070 ResetSslSession 592 El 13/07/2015 a les 17:12, RTT ha escrit: On 13-Jul-2015 14:15, Xavier Mor-Mur wrote: Content-Type: application/x-www-form-urlencoded Are you sure this is the Content-Type you should indicate? The HttpCli has this by default, but you are sending json data so probably the server is expecting "application/json"? -- Xavier Mor-Mur -- 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
[twsocket] Need help on https
Hi Angus The first one was to big in length (45k with a limit of 40k) and was parked waiting for moderator approval. Three days after I tried to send a new one with only start and end of debug file. I don't know what happened with the contents. Next is the post I tried to post last time with. I added a PostButton to OverbyteIcsHttpsTst example, as suggested RTT. The problem is always I get error. I need help to interpret debug file, let me know how to send the full debug. I would appreciate any help. PostButton click event: void __fastcall THttpTestForm::PostButtonClick(TObject *Sender) { AnsiString asPost; try { PrepareConnection(); Display("Connecting..."); PostButton->Enabled = FALSE; DocumentMemo->Clear(); SslHttpCli1->SendStream = new TStringStream(); asPost = PostMemo->Text; SslHttpCli1->SendStream->WriteBuffer(&asPost, asPost.Length()); SslHttpCli1->PostASync(); } catch (Exception& E) { Display("Connect error. " + E.ClassName() + ": " + E.Message); return; } } Example text to post: { "username": "demouser", "password": "demopassword", "clientid": "democlient", "signature": "f84WG29dH2gpMMGcvIV86DCLY+8=" } DocumentMemo result: Content type is application/xml; charset=utf-8 Document stored in "Validate" Size=393 Validate file content: xmlns="http://schemas.microsoft.com/ws/2005/05/envelope/none";>Sender El creador de este error no especificó una razón. xmlns:i="http://www.w3.org/2001/XMLSchema-instance";> PANIC! Debug_Out_HttpsTst.tx content (start and end, full contents can't be included as post goes up of 40k): 21:43:22:916 State = httpNotConnected 21:43:22:917 Login www.aa.net 21:43:22:918 State = httpDnsLookup 21:43:23:014 State = httpDnsLookupDone 21:43:23:014 connect to xxx.xxx.xxx.xxx/443 21:43:23:016 022A4070 Socket handle created 592 21:43:23:017 TWSocket will connect to xxx.xxx.xxx.xxx:443 21:43:23:053 SessionConnected 21:43:23:054 State = httpConnected 21:43:23:057 State = httpWaitingHeader 21:43:23:060 9 header lines to send POST /validation/v1/Validate HTTP/1.1 Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */* Connection: Keep-Alive Accept-Language: en, fr Content-Type: application/x-www-form-urlencoded User-Agent: Mozilla/4.0 (compatible; ICS) Host: www.aa.net Proxy-Connection: Keep-Alive Content-Length: 0 21:43:23:081 022A4070 PutDataInSslBuffer 592 len 317 [1] 21:43:23:084 022A4070 SslTryToSend 592 21:43:23:086 SendRequest Done 21:43:23:088 022A4070 StartSslHandshake 592 21:43:23:556 022A4070 InitSSLConnection 592 21:43:23:557 022A4070 BIO_ctrl(sslbio, BIO_C_SET_SSL, BIO_NOCLOSE, 0x7B57A0) = 1 [2] 21:43:23:558 022A4070 ICB> SSL_CB_HANDSHAKE_START ... (removed lines to avoid size limit) 21:45:34:430 022A4070 TriggerSslShutDownComplete(0) 592 21:45:34:432 022A4070 TCustomWSocket.Shutdown 1 592 21:45:34:433 022A4070 TriggerEvent sslFdClose 592 21:45:34:435 022A4070 SslShutdownCompleted *1* 592 21:45:34:436 022A4070 SslAsyncSelect 592, 32 FD_CLOSE 21:45:34:437 022A4070 TCustomSslWSocket.Do_FD_CLOSE error #0 592 21:45:34:439 022A4070 BIO_ctrl_pending(sslbio) = 0 [165] 21:45:34:441 022A4070 Socket data pending: 0 Err: 0 592 21:45:34:442 022A4070 FCloseInvoked=0 592 21:45:34:444 SessionClosed Error: 0 21:45:34:446 022A4070 ResetSslSession 592 Tanks in advance, Xavi -- 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
[twsocket] Fwd: Need more help on https
Some time ago I need help to contact secure web via post command. I modified PostButton. added to OverbyteIcsHttpsTst example, as suggested RTT. void __fastcall THttpTestForm::PostButtonClick(TObject *Sender) { AnsiString asPost; try { PrepareConnection(); Display("Connecting..."); PostButton->Enabled = FALSE; DocumentMemo->Clear(); SslHttpCli1->SendStream = new TStringStream(); asPost = PostMemo->Text; SslHttpCli1->SendStream->WriteBuffer(&asPost, asPost.Length()); SslHttpCli1->PostASync(); } catch (Exception& E) { Display("Connect error. " + E.ClassName() + ": " + E.Message); return; } } The problem is always I get error. I need help to interpret debug file (sorry it's length). I would appreciate any help. Tanks in advance, Xavi Example text to post: { "username": "demouser", "password": "demopassword", "clientid": "democlient", "signature": "f84WG29dH2gpMMGcvIV86DCLY+8=" } DocumentMemo result: Content type is application/xml; charset=utf-8 Document stored in "Validate" Size=393 Validate file content: xmlns="http://schemas.microsoft.com/ws/2005/05/envelope/none";>Sender El creador de este error no especificó una razón. xmlns:i="http://www.w3.org/2001/XMLSchema-instance";> PANIC! Debug_Out_HttpsTst.tx content: 21:43:22:916 State = httpNotConnected 21:43:22:917 Login www.aa.net 21:43:22:918 State = httpDnsLookup 21:43:23:014 State = httpDnsLookupDone 21:43:23:014 connect to xxx.xxx.xxx.xxx/443 21:43:23:016 022A4070 Socket handle created 592 21:43:23:017 TWSocket will connect to xxx.xxx.xxx.xxx:443 21:43:23:053 SessionConnected 21:43:23:054 State = httpConnected 21:43:23:057 State = httpWaitingHeader 21:43:23:060 9 header lines to send POST /validation/v1/Validate HTTP/1.1 Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */* Connection: Keep-Alive Accept-Language: en, fr Content-Type: application/x-www-form-urlencoded User-Agent: Mozilla/4.0 (compatible; ICS) Host: www.aa.net Proxy-Connection: Keep-Alive Content-Length: 0 21:43:23:081 022A4070 PutDataInSslBuffer 592 len 317 [1] 21:43:23:084 022A4070 SslTryToSend 592 21:43:23:086 SendRequest Done 21:43:23:088 022A4070 StartSslHandshake 592 21:43:23:556 022A4070 InitSSLConnection 592 21:43:23:557 022A4070 BIO_ctrl(sslbio, BIO_C_SET_SSL, BIO_NOCLOSE, 0x7B57A0) = 1 [2] 21:43:23:558 022A4070 ICB> SSL_CB_HANDSHAKE_START ... (removed lines to avoid size limit) 21:45:34:409 022A4070 TriggerEvents 592 SslState: SSL_ST_OK // MayFD_Read=0 MayDoRecv=-1 MayFD_Write=-1 MaySslTryToSend=-1 bSslAllSent=-1 bAllSent=-1 21:45:34:410 022A4070 BIO_ctrl_pending(nbio) = 27 [156] 21:45:34:412 022A4070 TriggerEvent sslFdWrite 592 21:45:34:414 022A4070 BIO_ctrl_pending(sslbio) = 0 [157] 21:45:34:415 022A4070 BIO_ctrl_get_write_guarantee(nbio) = 4096 [158] 21:45:34:417 022A4070 SslAsyncSelect 592, 2 FD_WRITE 21:45:34:419 022A4070 TCustomSslWSocket.Do_FD_WRITE 592 21:45:34:421 022A4070 BIO_ctrl_pending(nbio) = 27 [159] 21:45:34:423 022A4070 BIO_read(nbio, 0x18BC88, 27) = 27 [160] 21:45:34:425 022A4070 my_RealSend (0x250, 1621128, 27) = 27 [161] 21:45:34:426 022A4070 BIO_ctrl_pending(nbio) = 0 [162] 21:45:34:428 022A4070 BIO_ctrl_pending(nbio) = 0 [163] 21:45:34:429 022A4070 BIO_ctrl_pending(nbio) = 0 [164] 21:45:34:430 022A4070 TriggerSslShutDownComplete(0) 592 21:45:34:432 022A4070 TCustomWSocket.Shutdown 1 592 21:45:34:433 022A4070 TriggerEvent sslFdClose 592 21:45:34:435 022A4070 SslShutdownCompleted *1* 592 21:45:34:436 022A4070 SslAsyncSelect 592, 32 FD_CLOSE 21:45:34:437 022A4070 TCustomSslWSocket.Do_FD_CLOSE error #0 592 21:45:34:439 022A4070 BIO_ctrl_pending(sslbio) = 0 [165] 21:45:34:441 022A4070 Socket data pending: 0 Err: 0 592 21:45:34:442 022A4070 FCloseInvoked=0 592 21:45:34:444 SessionClosed Error: 0 21:45:34:446 022A4070 ResetSslSession 592 -- Xavier Mor-Mur -- 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
Re: [twsocket] Need help on using https
Thanks RTT Finally it works. I was not using correctly SendStream. Regards, Xavi El 11/06/2015 a les 0:53, RTT ha escrit: On 10/06/2015 19:58, Xavier Mor-Mur wrote: I tried with sample OverbyteIcsHttpsTst but don't get success changing Get command for Post-. Are you putting the data to post in the SslHttpCli1.SendStream? e.g. SslHttpCli1.SendStream:=TStringStream.Create; TStringStream(SslHttpCli1.SendStream).WriteString(' {username:my_username,password:my_password,clientid:my_clientid,signature:my_signature}'); SslHttpCli1.PostAsync; -- Xavier Mor-Mur -- 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
[twsocket] Need help on using https
Hi to all It's the first time I need access to secure server using command post and wait for result. I don't know correct steps. All I know it's the url and what I should post. Something like this: url : https://www.server.net/validate post : {username:my_username,password:my_password,clientid:my_clientid,signature:my_signature} I tried with sample OverbyteIcsHttpsTst but don't get success changing Get command for Post-. I would appreciate any help Thanks for advance -- Xavier Mor-Mur -- 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