
Hi guys,
I have problem regarding to connecting to the JIRA webservice from Dynamics AX 2009 over HTTPS connection. When creating a new webservice reference, the creation freezes and finally i'm getting timeout error. After some code analysis, i've found out, that System.Net.WebResponse is the one, which is getting timeout.. When I tried to use the same classes from Visual Studio in C#, it worked smoothly. Can it be problem with SSL certificate? My server uses certificate, which was generated by ourselves, but is not verified by any of Certification Authorities.
I've tried resolving server alias via DNS, pinging host and opening sockets on 443 and 80 ports and it all worked from AX, so I think it is not a problem with network. Furthermore, I've tried to connect to webservice of annother JIRA instance, with certificate signed by GeoTrust, Inc. and it worked.
*This post is locked for comments
I have the same question (0)Hi again,
I've found the solution by myself. I turned out to be a problem with secured connection protocol.
Here's my code:
static server public void webRequestWithSSL(str _uriStr) { System.Net.WebRequest webRequest; System.Net.WebResponse webResponse; CLRObject clro; System.Exception ex; str castStr, castStr2; int castInt; ; try { new InteropPermission(InteropKind::ClrInterop).assert(); System.Net.ServicePointManager::set_SecurityProtocol(System.Net.SecurityProtocolType::Ssl3); webRequest = System.Net.WebRequest::Create(_uriStr); webRequest.set_Method("GET"); webRequest.set_UseDefaultCredentials(true); webRequest.set_Timeout(10000); webRequest.set_Proxy( new System.Net.WebProxy()); // this will throw an webexception if cannot be reached. webResponse = webRequest.GetResponse(); info("WebResponse Connection OK"); webResponse.Close(); CodeAccessPermission::revertAssert(); } catch(Exception::CLRError) { ex = ClrInterop::getLastException(); if (ex != null) { error(ex.ToString()); ex = ex.get_InnerException(); if (ex != null) { error(ex.ToString()); } } } catch { error("Unknown Error"); } }
All I needed to do is to set security protocol type to SSL3, because TLS is not working properly. I've found this solution here: