I am making a service that needs to send a request to a soap service. This call needs to use a certificate from a pfx file. The code works while i am debugging but gives the error "The request was aborted: Could not create SSL/TLS secure channel" in the testing server.
The call works in both machines with soapUI.
My code looks like:
//Create the http request
HttpWebRequest getDocumentpdfRequest = (HttpWebRequest)WebRequest.Create(requestUrl);
//Add content type
getDocumentpdfRequest.ContentType = "text/xml;charset=UTF-8";
//Add method
getDocumentpdfRequest.Method = "POST";
//Add SOAP action
getDocumentpdfRequest.Headers.Add("SOAPAction", "GetDocumentMTOM");
//Add the certificate to the request
getDocumentpdfRequest.ClientCertificates.Add(cert);
WebResponse getDocumentpdfResponse = getDocumentpdfRequest.GetResponse();
I have already added "ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;"