PoojaKrishna Posted May 27, 2018 Share Posted May 27, 2018 (edited) Hi friends, A script of mine stopped working suddenly. I am posting here the part of code that causes the issue. $sPD = "" $oMyError = ObjEvent("AutoIt.Error","MyErrFunc") ; Initialize a COM error handler Local $oHTTP = ObjCreate("winhttp.winhttprequest.5.1") $oHTTP.Open("POST", "https://cryptlex.com/services/api/pkey/generate", False) $oHTTP.SetRequestHeader("Content-Type", "application/x-www-form-urlencoded") $oHTTP.Send($sPD) Local $oReceived = $oHTTP.ResponseText Msgbox(0,"", $oReceived) Local $oStatusCode = $oHTTP.Status Msgbox(0,"", $oReceived) ;error handler Func MyErrFunc() Msgbox(0,"AutoItCOM Test","We intercepted a COM Error !" & @CRLF & @CRLF & _ "err.description is: " & @TAB & $oMyError.description & @CRLF & _ "err.windescription:" & @TAB & $oMyError.windescription & @CRLF & _ "err.number is: " & @TAB & hex($oMyError.number,8) & @CRLF & _ "err.lastdllerror is: " & @TAB & $oMyError.lastdllerror & @CRLF & _ "err.scriptline is: " & @TAB & $oMyError.scriptline & @CRLF & _ "err.source is: " & @TAB & $oMyError.source & @CRLF & _ "err.helpfile is: " & @TAB & $oMyError.helpfile & @CRLF & _ "err.helpcontext is: " & @TAB & $oMyError.helpcontext _ ) Endfunc When I execute from the editor is shown an error on the statement : $oHTTP.Send($sPD), Request with object failed. The script got stopped on a Windows -7 machine. I have tested the part of code on a Windows 10 machine and is working good. Here is the details of the error: We intercepted a COM Error ! err.description is: An error occurred in the secure channel support err.windescription: Exception occurred. err.number is: 80020009 err.lastdllerror is: 0 err.scriptline is: 6 err.source is: WinHttp.WinHttpRequest err.helpfile is: err.helpcontext is: 0 Please help. I have searched through out the forum but no help :-( Edited May 31, 2018 by PoojaKrishna Link to comment Share on other sites More sharing options...
TheXman Posted May 27, 2018 Share Posted May 27, 2018 (edited) The most likely issue is that the web site now requires secure connections to use newer TLS protocols. Windows 7, if not specifically updated, did not contain the definitions and services to use TLS 1.1 or 1.2. Windows 10 did come with these definitions and services. You can use this link to give you a starting point to understanding the possible issue and how to resolve it. Update to enable TLS 1.1 and TLS 1.2 as a default secure protocols in WinHTTP in Windows Edited May 27, 2018 by TheXman PoojaKrishna and mLipok 1 1 CryptoNG UDF: Cryptography API: Next Gen jq UDF: Powerful and Flexible JSON Processor | jqPlayground: An Interactive JSON Processor Xml2Json UDF: Transform XML to JSON | HttpApi UDF: HTTP Server API | Roku Remote: Example Script About Me How To Ask Good Questions On Technical And Scientific Forums (Detailed) | How to Ask Good Technical Questions (Brief) "Any fool can know. The point is to understand." -Albert Einstein "If you think you're a big fish, it's probably because you only swim in small ponds." ~TheXman Link to comment Share on other sites More sharing options...
PoojaKrishna Posted May 27, 2018 Author Share Posted May 27, 2018 Thank you so much for your reply. I am travelling. Will check the link and will post the solution by Tuesday. Link to comment Share on other sites More sharing options...
PoojaKrishna Posted May 31, 2018 Author Share Posted May 31, 2018 On 5/27/2018 at 6:54 PM, TheXman said: The most likely issue is that the web site now requires secure connections to use newer TLS protocols. Windows 7, if not specifically updated, did not contain the definitions and services to use TLS 1.1 or 1.2. Windows 10 did come with these definitions and services. You can use this link to give you a starting point to understanding the possible issue and how to resolve it. Update to enable TLS 1.1 and TLS 1.2 as a default secure protocols in WinHTTP in Windows Thank you so much. Issue solved. Link to comment Share on other sites More sharing options...
zenmark22 Posted May 23, 2022 Share Posted May 23, 2022 On 5/31/2018 at 4:53 AM, PoojaKrishna said: Thank you so much. Issue solved. Hi, I have the same problem. Can you show me your example please? How you fix it? Thank you! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now