Error Connecting Ssl Indy
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Delphi 6 and Indy SSL connection not working up vote 1 down vote favorite 1 I need to consume a Web Service via SSL. In order to accomplish that I have built a web client in Delphi 6 that uses Indy to read the client certificates and write the soap request via https. The compilated version of the code is a DLL that runs in IIS 5.0. After tested the code in my local machine it works fine (I'm behind a proxy). But after the code is deployed to prod servers (not proxy) the SSL connection fails saying "Error connecting with SSL". Here is my code: var Response: TStringStream; IdHttp: TIdHTTP; IdCnxSLL: TIdConnectionInterceptOpenSSL; XmlSoapDoc: IXMLDocument; begin Response := TStringStream.Create(''); IdHttp := TIdHTTP.Create(nil); IdCnxSLL := TIdConnectionInterceptOpenSSL.Create(nil); XmlSoapDoc := TXMLDocument.Create(nil); with IdCnxSLL do begin IdCnxSLL.SSLOptions.Method := sslvSSLv23; IdCnxSLL.SSLOptions.RootCertFile := IniHttpConnectionData.Values['RootCertFile']; IdCnxSLL.SSLOptions.CertFile := IniHttpConnectionData.Values['CertFile']; IdCnxSLL.SSLOptions.KeyFile := IniHttpConnectionData.Values['KeyFile']; IdCnxSLL.OnGetPassword := IdConInterceptOpenSSLGetPassword; end; with IdHttp do begin if bUseProxy then begin Request.ProxyServer := IniHttpConnectionData.Values['ProxyServer']; Request.ProxyPort := StrToIntDef(IniHttpConnectionData.Values['ProxyPort'], 0); end else begin Host := IniHttpConnectionData.Values['HTTPHost']; Port := StrToIntDef(IniHttpConnectionData.Values['HTTPPort'], 443); end; Request.ContentType := 'text/xml'; Intercept := IdCnxSLL; InterceptEnabled := True; end; try IdHttp.Post(ServiceURL, SoapEnv, Response); except on E:EIdOSSLConnectError do LogError('SSL Connect Error: ' + E.Message); on E:Exception do LogError(
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community http://stackoverflow.com/questions/1422586/delphi-6-and-indy-ssl-connection-not-working of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Cannot connect to Indy SSL TCP server up vote 2 down vote favorite 2 I am trying to build the server and the client applications that communicate via Indy SSL TCP components (C++ Builder 2010). http://stackoverflow.com/questions/21768381/cannot-connect-to-indy-ssl-tcp-server I've generated certificate and private key with following command: openssl req -x509 -newkey rsa:2048 -keyout key.pem -out cert.pem -days 365 -config C:\openssl.cnf Server code: #include
for Help Receive Real-Time Help Create a Freelance Project Hire for a Full Time Job Ways to Get Help Ask a Question Ask for Help Receive Real-Time Help Create a Freelance Project Hire for a Full https://www.experts-exchange.com/questions/23268455/Error-connecting-with-SSL-Indy-9.html Time Job Ways to Get Help Expand Search Submit Close Search Login Join Today Products BackProducts Gigs Live Careers Vendor Services Groups Website Testing Store Headlines Experts Exchange > Questions > Error connecting http://blog.coolsoftware.ru/2011/11/ssl-delphi.html with SSL (Indy 9) Want to Advertise Here? Solved Error connecting with SSL (Indy 9) Posted on 2008-03-25 Delphi 1 Verified Solution 5 Comments 6,645 Views Last Modified: 2008-07-23 Hi everyone, I'm a error connecting delphi 5 programmer and I'm using indy 9 to send a SOAP file, this is pretty new to me but I was able to create a idhtttp object and connect to the right url but when I post the file, I'm getting this error: error connecting with SSL I have tried downloading libeay32.dll and ssleay32.dll but still, this error shows up, these are made for indy error connecting ssl 9 but I can't really know if they are the right version exactly. Any suggestions on what I should do? 0 Question by:Buropro-Citation Facebook Twitter LinkedIn Google LVL 28 Best Solution byciuly I know they are not sending soap. what they are sending is irrelevant. http is the same for everybody. you send something. you get something. the idea is that you look at thos eprojects to see how Go to Solution 5 Comments LVL 28 Overall: Level 28 Delphi 25 Message Expert Comment by:ciuly2008-03-25 what is the exact error? did you set up ssl correctly? make sure the ssl version is set up correctly as well. you can take a peek at some of my ssl indy examples here: http://www.ciuly.com/delphi/indy/ 0 Message Active 5 days ago Author Comment by:Buropro-Citation2008-03-25 The error is a EidOSSLconnectError exception, the exact error message is 'error connecting with SSL', not much detail in there unfortunatly. I haven't set up the SSL tough, I have installed indy 9 and then copied the 2 dll mentioned earlier in my project directory, can you show me how to set it up? On the internet I was able to find indy
в моей программе на Delphi. Эта программа была написана довольно давно, на Delphi 7 с использованием Indy 9. Вот как выглядит проверка сертификата: var IdHTTP: TIdHTTP; IdSSLIOHandlerSocket: TIdSSLIOHandlerSocket; begin IdHTTP := TIdHTTP.Create(nil); IdSSLIOHandlerSocket := TIdSSLIOHandlerSocket.Create(nil); IdHTTP.IOHandler := IdSSLIOHandlerSocket; with IdSSLIOHandlerSocket do begin SSLOptions.Method := sslvSSLv23; SSLOptions.Mode := sslmClient; SSLOptions.VerifyMode := [sslvrfPeer]; SSLOptions.VerifyDepth := 10; end; IdHTTP.Get('https://www.google.com'); FreeAndNil(IdHTTP); FreeAndNil(IdSSLIOHandlerSocket); end; Если попробовать выполнить выше приведенный код, то результат будет всегда такой: Error connecting with SSL. Проблема тут в том, что в Indy используется OpenSSL, который не умеет работать с хранилищем сертификатов Windows и не может проверить подписан ли сертификат, полученный от сервера, одним из доверенных корневых сертификатов из этого хранилища. Посмотрим в исходник модуля IdSSLOpenSSL. В нем есть такая функция: function VerifyCallback(Ok: Integer; ctx: PX509_STORE_CTX): Integer; cdecl; var hcert: PX509; Certificate: TIdX509; hSSL: PSSL; IdSSLSocket: TIdSSLSocket; // str: String; VerifiedOK: Boolean; Depth: Integer; // Error: Integer; begin LockVerifyCB.Enter; try VerifiedOK := True; try hcert := IdSslX509StoreCtxGetCurrentCert(ctx); hSSL := IdSslX509StoreCtxGetAppData(ctx); Certificate := TIdX509.Create(hcert); if hSSL <> nil then begin IdSSLSocket := TIdSSLSocket(IdSslGetAppData(hSSL)); end else begin Result := Ok; exit; end; //Error := IdSslX509StoreCtxGetError(ctx); // Depth := IdSslX509StoreCtxGetErrorDepth(ctx); // str := Format('Certificate: %s', [Certificate.Subject.OneLine]); {Do not Localize} // str := IdSSLSocket.GetSessi