Http Post Indy10 Error Delphi 7: Error creating SSL context The Next CEO of Stack OverflowWhat's the difference between a POST and a PUT HTTP REQUEST?Sending HTTP POST Request In JavaHow to make HTTP POST web requestHTTP test server accepting GET/POST requestsHow is an HTTP POST request made in node.js?Getting only response header from HTTP POST using curlHow are parameters sent in an HTTP POST request?TCP/IP with SSL - Delphi and Indy10HTTPS client and server together using C++ and POCO libraries (SSL context issues)?Delphi/Indy10 How to check an https URL is valid without downloading contents

Is there always a complete, orthogonal set of unitary matrices?

Is French Guiana a (hard) EU border?

Necessary condition on homology group for a set to be contractible

Why don't programming languages automatically manage the synchronous/asynchronous problem?

What flight has the highest ratio of timezone difference to flight time?

Does increasing your ability score affect your main stat?

What did we know about the Kessel run before the prequels?

Is wanting to ask what to write an indication that you need to change your story?

Is there a difference between "Fahrstuhl" and "Aufzug"

Running a General Election and the European Elections together

The exact meaning of 'Mom made me a sandwich'

Would this house-rule that treats advantage as a +1 to the roll instead (and disadvantage as -1) and allows them to stack be balanced?

What happened in Rome, when the western empire "fell"?

Is it ever safe to open a suspicious HTML file (e.g. email attachment)?

Does Germany produce more waste than the US?

Is it okay to majorly distort historical facts while writing a fiction story?

Bartok - Syncopation (1): Meaning of notes in between Grand Staff

What connection does MS Office have to Netscape Navigator?

Domestic-to-international connection at Orlando (MCO)

Flying from Cape Town to England and return to another province

Why did CATV standarize in 75 ohms and everyone else in 50?

How many extra stops do monopods offer for tele photographs?

Legal workarounds for testamentary trust perceived as unfair

Unclear about dynamic binding



Http Post Indy10 Error Delphi 7: Error creating SSL context



The Next CEO of Stack OverflowWhat's the difference between a POST and a PUT HTTP REQUEST?Sending HTTP POST Request In JavaHow to make HTTP POST web requestHTTP test server accepting GET/POST requestsHow is an HTTP POST request made in node.js?Getting only response header from HTTP POST using curlHow are parameters sent in an HTTP POST request?TCP/IP with SSL - Delphi and Indy10HTTPS client and server together using C++ and POCO libraries (SSL context issues)?Delphi/Indy10 How to check an https URL is valid without downloading contents










0















I'm using Delphi 7 with Indy 10.6.2.5459 to make a POST request to a server from time to time:



sParams := '?ultimaAlteracao='+FormatDateTime('YYYY-MM-DD',now())+'T00:00:00.000';
FidHTTP := TIdHTTP.Create;
try
FidHTTP.Request.Clear;
FidHTTP.Request.Accept := 'application/json;charset=UTF-8';
FidHTTP.Request.CharSet := 'UTF-8';
FidHTTP.Response.ContentType := 'application/json;charset=UTF-8';
FidHTTP.Response.ContentEncoding := 'UTF-8';
FidHTTP.Request.CustomHeaders.AddValue('Authorization','Basic '+EncodeBase64('xx:xx@123456'));

JsonStream := TStringStream.Create('');
JsonStream.Position := 0;
try
FidHTTP.Get('https://'+server+'/LinxImportacaoArquivo/GetSelecaoDadosMDMNCM'+sParams, JsonStream);
DataString := JsonStream.DataString;
finally
FreeAndNil(JsonStream);
end;
finally
FreeAndNil(FidHTTP);
end;


After sometime, it begins to fail and returns:




Error creating SSL context. error:140A90F1:SSL
routines:SSL_CTX_new:unable to load ssl2 md5 routines




If I restart the application, it works for sometime again.
I found some people who had the same issue: here and here



From what I learned, it can be some other process which uses Indy to make a request that is interfering, and I quote




It appears to be an issue with some type of static member
initialization inside the openssl library. I have 2 libraries, both of
them use the openssl library, let's call them A and B. When the
application starts up both A & B are able to successfully create a
security context. Later, when library B tries to create another
security context it fails. Both library A and B are module plugins to
our application so they both will load but if one is not needed it is
unloaded.




Indeed, my application has a lot of others process executing, making http requests, through indy10 or WinInet.



So, my question is: Is there some procedure I can call on Indy10 to make it initialize something that had it freed on opensll library?










share|improve this question

















  • 1





    On a side note, you should not by using the TIdHTTP.Request.CustomHeaders property to send Basic authentication credentials manually. Set TIdHTTP.Request.BasicAuthentication=true and use the TIdHTTP.Request.Username and TIdHTTP.Request.Password properties instead. And UTF-8 is not a valid ContentEncoding. And when receiving string responses, you should use the overload of TIdHTTP.Get() that returns a string rather than the overload that fills a TStream, let TIdHTTP handle the response's charset for you: DataString := FidHTTP.Get(url);

    – Remy Lebeau
    Mar 21 at 19:40
















0















I'm using Delphi 7 with Indy 10.6.2.5459 to make a POST request to a server from time to time:



sParams := '?ultimaAlteracao='+FormatDateTime('YYYY-MM-DD',now())+'T00:00:00.000';
FidHTTP := TIdHTTP.Create;
try
FidHTTP.Request.Clear;
FidHTTP.Request.Accept := 'application/json;charset=UTF-8';
FidHTTP.Request.CharSet := 'UTF-8';
FidHTTP.Response.ContentType := 'application/json;charset=UTF-8';
FidHTTP.Response.ContentEncoding := 'UTF-8';
FidHTTP.Request.CustomHeaders.AddValue('Authorization','Basic '+EncodeBase64('xx:xx@123456'));

JsonStream := TStringStream.Create('');
JsonStream.Position := 0;
try
FidHTTP.Get('https://'+server+'/LinxImportacaoArquivo/GetSelecaoDadosMDMNCM'+sParams, JsonStream);
DataString := JsonStream.DataString;
finally
FreeAndNil(JsonStream);
end;
finally
FreeAndNil(FidHTTP);
end;


After sometime, it begins to fail and returns:




Error creating SSL context. error:140A90F1:SSL
routines:SSL_CTX_new:unable to load ssl2 md5 routines




If I restart the application, it works for sometime again.
I found some people who had the same issue: here and here



From what I learned, it can be some other process which uses Indy to make a request that is interfering, and I quote




It appears to be an issue with some type of static member
initialization inside the openssl library. I have 2 libraries, both of
them use the openssl library, let's call them A and B. When the
application starts up both A & B are able to successfully create a
security context. Later, when library B tries to create another
security context it fails. Both library A and B are module plugins to
our application so they both will load but if one is not needed it is
unloaded.




Indeed, my application has a lot of others process executing, making http requests, through indy10 or WinInet.



So, my question is: Is there some procedure I can call on Indy10 to make it initialize something that had it freed on opensll library?










share|improve this question

















  • 1





    On a side note, you should not by using the TIdHTTP.Request.CustomHeaders property to send Basic authentication credentials manually. Set TIdHTTP.Request.BasicAuthentication=true and use the TIdHTTP.Request.Username and TIdHTTP.Request.Password properties instead. And UTF-8 is not a valid ContentEncoding. And when receiving string responses, you should use the overload of TIdHTTP.Get() that returns a string rather than the overload that fills a TStream, let TIdHTTP handle the response's charset for you: DataString := FidHTTP.Get(url);

    – Remy Lebeau
    Mar 21 at 19:40














0












0








0








I'm using Delphi 7 with Indy 10.6.2.5459 to make a POST request to a server from time to time:



sParams := '?ultimaAlteracao='+FormatDateTime('YYYY-MM-DD',now())+'T00:00:00.000';
FidHTTP := TIdHTTP.Create;
try
FidHTTP.Request.Clear;
FidHTTP.Request.Accept := 'application/json;charset=UTF-8';
FidHTTP.Request.CharSet := 'UTF-8';
FidHTTP.Response.ContentType := 'application/json;charset=UTF-8';
FidHTTP.Response.ContentEncoding := 'UTF-8';
FidHTTP.Request.CustomHeaders.AddValue('Authorization','Basic '+EncodeBase64('xx:xx@123456'));

JsonStream := TStringStream.Create('');
JsonStream.Position := 0;
try
FidHTTP.Get('https://'+server+'/LinxImportacaoArquivo/GetSelecaoDadosMDMNCM'+sParams, JsonStream);
DataString := JsonStream.DataString;
finally
FreeAndNil(JsonStream);
end;
finally
FreeAndNil(FidHTTP);
end;


After sometime, it begins to fail and returns:




Error creating SSL context. error:140A90F1:SSL
routines:SSL_CTX_new:unable to load ssl2 md5 routines




If I restart the application, it works for sometime again.
I found some people who had the same issue: here and here



From what I learned, it can be some other process which uses Indy to make a request that is interfering, and I quote




It appears to be an issue with some type of static member
initialization inside the openssl library. I have 2 libraries, both of
them use the openssl library, let's call them A and B. When the
application starts up both A & B are able to successfully create a
security context. Later, when library B tries to create another
security context it fails. Both library A and B are module plugins to
our application so they both will load but if one is not needed it is
unloaded.




Indeed, my application has a lot of others process executing, making http requests, through indy10 or WinInet.



So, my question is: Is there some procedure I can call on Indy10 to make it initialize something that had it freed on opensll library?










share|improve this question














I'm using Delphi 7 with Indy 10.6.2.5459 to make a POST request to a server from time to time:



sParams := '?ultimaAlteracao='+FormatDateTime('YYYY-MM-DD',now())+'T00:00:00.000';
FidHTTP := TIdHTTP.Create;
try
FidHTTP.Request.Clear;
FidHTTP.Request.Accept := 'application/json;charset=UTF-8';
FidHTTP.Request.CharSet := 'UTF-8';
FidHTTP.Response.ContentType := 'application/json;charset=UTF-8';
FidHTTP.Response.ContentEncoding := 'UTF-8';
FidHTTP.Request.CustomHeaders.AddValue('Authorization','Basic '+EncodeBase64('xx:xx@123456'));

JsonStream := TStringStream.Create('');
JsonStream.Position := 0;
try
FidHTTP.Get('https://'+server+'/LinxImportacaoArquivo/GetSelecaoDadosMDMNCM'+sParams, JsonStream);
DataString := JsonStream.DataString;
finally
FreeAndNil(JsonStream);
end;
finally
FreeAndNil(FidHTTP);
end;


After sometime, it begins to fail and returns:




Error creating SSL context. error:140A90F1:SSL
routines:SSL_CTX_new:unable to load ssl2 md5 routines




If I restart the application, it works for sometime again.
I found some people who had the same issue: here and here



From what I learned, it can be some other process which uses Indy to make a request that is interfering, and I quote




It appears to be an issue with some type of static member
initialization inside the openssl library. I have 2 libraries, both of
them use the openssl library, let's call them A and B. When the
application starts up both A & B are able to successfully create a
security context. Later, when library B tries to create another
security context it fails. Both library A and B are module plugins to
our application so they both will load but if one is not needed it is
unloaded.




Indeed, my application has a lot of others process executing, making http requests, through indy10 or WinInet.



So, my question is: Is there some procedure I can call on Indy10 to make it initialize something that had it freed on opensll library?







post openssl delphi-7 indy10






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Mar 21 at 18:01









SamuelSamuel

687




687







  • 1





    On a side note, you should not by using the TIdHTTP.Request.CustomHeaders property to send Basic authentication credentials manually. Set TIdHTTP.Request.BasicAuthentication=true and use the TIdHTTP.Request.Username and TIdHTTP.Request.Password properties instead. And UTF-8 is not a valid ContentEncoding. And when receiving string responses, you should use the overload of TIdHTTP.Get() that returns a string rather than the overload that fills a TStream, let TIdHTTP handle the response's charset for you: DataString := FidHTTP.Get(url);

    – Remy Lebeau
    Mar 21 at 19:40













  • 1





    On a side note, you should not by using the TIdHTTP.Request.CustomHeaders property to send Basic authentication credentials manually. Set TIdHTTP.Request.BasicAuthentication=true and use the TIdHTTP.Request.Username and TIdHTTP.Request.Password properties instead. And UTF-8 is not a valid ContentEncoding. And when receiving string responses, you should use the overload of TIdHTTP.Get() that returns a string rather than the overload that fills a TStream, let TIdHTTP handle the response's charset for you: DataString := FidHTTP.Get(url);

    – Remy Lebeau
    Mar 21 at 19:40








1




1





On a side note, you should not by using the TIdHTTP.Request.CustomHeaders property to send Basic authentication credentials manually. Set TIdHTTP.Request.BasicAuthentication=true and use the TIdHTTP.Request.Username and TIdHTTP.Request.Password properties instead. And UTF-8 is not a valid ContentEncoding. And when receiving string responses, you should use the overload of TIdHTTP.Get() that returns a string rather than the overload that fills a TStream, let TIdHTTP handle the response's charset for you: DataString := FidHTTP.Get(url);

– Remy Lebeau
Mar 21 at 19:40






On a side note, you should not by using the TIdHTTP.Request.CustomHeaders property to send Basic authentication credentials manually. Set TIdHTTP.Request.BasicAuthentication=true and use the TIdHTTP.Request.Username and TIdHTTP.Request.Password properties instead. And UTF-8 is not a valid ContentEncoding. And when receiving string responses, you should use the overload of TIdHTTP.Get() that returns a string rather than the overload that fills a TStream, let TIdHTTP handle the response's charset for you: DataString := FidHTTP.Get(url);

– Remy Lebeau
Mar 21 at 19:40













1 Answer
1






active

oldest

votes


















0














I found out that at unit IdSSLOpenSSL there's a procedure named UnLoadOpenSSLLibrary.
If I always call that procedure before my code, the error does not occurr.






share|improve this answer























  • Indy does not unload and reload OpenSSL multiple times, once loaded it stays loaded (unless you unload it manually), so this issue really shouldn't be happening in the first place, unless you are using Indy in a package and that package is unloaded and reloaded multiple times. It is really not a good idea to unload OpenSSL once it has been loaded, as it has internal issues with doing that, it is really not an unload-safe library.

    – Remy Lebeau
    Mar 21 at 19:44











Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55286604%2fhttp-post-indy10-error-delphi-7-error-creating-ssl-context%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














I found out that at unit IdSSLOpenSSL there's a procedure named UnLoadOpenSSLLibrary.
If I always call that procedure before my code, the error does not occurr.






share|improve this answer























  • Indy does not unload and reload OpenSSL multiple times, once loaded it stays loaded (unless you unload it manually), so this issue really shouldn't be happening in the first place, unless you are using Indy in a package and that package is unloaded and reloaded multiple times. It is really not a good idea to unload OpenSSL once it has been loaded, as it has internal issues with doing that, it is really not an unload-safe library.

    – Remy Lebeau
    Mar 21 at 19:44















0














I found out that at unit IdSSLOpenSSL there's a procedure named UnLoadOpenSSLLibrary.
If I always call that procedure before my code, the error does not occurr.






share|improve this answer























  • Indy does not unload and reload OpenSSL multiple times, once loaded it stays loaded (unless you unload it manually), so this issue really shouldn't be happening in the first place, unless you are using Indy in a package and that package is unloaded and reloaded multiple times. It is really not a good idea to unload OpenSSL once it has been loaded, as it has internal issues with doing that, it is really not an unload-safe library.

    – Remy Lebeau
    Mar 21 at 19:44













0












0








0







I found out that at unit IdSSLOpenSSL there's a procedure named UnLoadOpenSSLLibrary.
If I always call that procedure before my code, the error does not occurr.






share|improve this answer













I found out that at unit IdSSLOpenSSL there's a procedure named UnLoadOpenSSLLibrary.
If I always call that procedure before my code, the error does not occurr.







share|improve this answer












share|improve this answer



share|improve this answer










answered Mar 21 at 19:03









SamuelSamuel

687




687












  • Indy does not unload and reload OpenSSL multiple times, once loaded it stays loaded (unless you unload it manually), so this issue really shouldn't be happening in the first place, unless you are using Indy in a package and that package is unloaded and reloaded multiple times. It is really not a good idea to unload OpenSSL once it has been loaded, as it has internal issues with doing that, it is really not an unload-safe library.

    – Remy Lebeau
    Mar 21 at 19:44

















  • Indy does not unload and reload OpenSSL multiple times, once loaded it stays loaded (unless you unload it manually), so this issue really shouldn't be happening in the first place, unless you are using Indy in a package and that package is unloaded and reloaded multiple times. It is really not a good idea to unload OpenSSL once it has been loaded, as it has internal issues with doing that, it is really not an unload-safe library.

    – Remy Lebeau
    Mar 21 at 19:44
















Indy does not unload and reload OpenSSL multiple times, once loaded it stays loaded (unless you unload it manually), so this issue really shouldn't be happening in the first place, unless you are using Indy in a package and that package is unloaded and reloaded multiple times. It is really not a good idea to unload OpenSSL once it has been loaded, as it has internal issues with doing that, it is really not an unload-safe library.

– Remy Lebeau
Mar 21 at 19:44





Indy does not unload and reload OpenSSL multiple times, once loaded it stays loaded (unless you unload it manually), so this issue really shouldn't be happening in the first place, unless you are using Indy in a package and that package is unloaded and reloaded multiple times. It is really not a good idea to unload OpenSSL once it has been loaded, as it has internal issues with doing that, it is really not an unload-safe library.

– Remy Lebeau
Mar 21 at 19:44



















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55286604%2fhttp-post-indy10-error-delphi-7-error-creating-ssl-context%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

은진 송씨 목차 역사 본관 분파 인물 조선 왕실과의 인척 관계 집성촌 항렬자 인구 같이 보기 각주 둘러보기 메뉴은진 송씨세종실록 149권, 지리지 충청도 공주목 은진현