I am having an issue trying to deploy a WebApi which makes an outbound Soap call to a Remote System to a IIS Server. I can run my Code on my Workstation with no problems but when i deploy to Server it fails. I even went so far to install visual Studio to my Server and run the code in Studio and it also works fine. No matter from where i deploy the code , from local ore Remote Studio 2019 it always fails on the Server with the following error.
The request was aborted: Could not create SSL/TLS secure channel
Below is the function i call to make the request which causes the error and throws a webexception.
Try
Dim log As New logger
Dim aTTADDRVALRESP As ATT_ADDR_VAL_RESP = Nothing
Dim timeSpan As System.TimeSpan
Dim now As System.DateTime = System.DateTime.Now
Dim startTime As System.DateTime = Conversions.ToDate(Now.ToString("HH:mm:ss.fff"))
Try
Dim results() As Object = Me.Invoke("submitAddVal", New Object() {ATT_ADDR_VAL_REQ})
Dim myCodes As XmlHelper.AttResponseCode = New XmlHelper.AttResponseCode()
myCodes = XmlHelper.GetAttResponseCodes(XmlHelper.DebugXML(results(0)))
System.Diagnostics.Debug.WriteLine(myCodes.ToString)
now = System.DateTime.Now
Dim [date] As System.DateTime = Conversions.ToDate(now.ToString("HH:mm:ss.fff"))
timeSpan = [date].Subtract(startTime)
Dim totalMilliseconds As Double = timeSpan.TotalMilliseconds
aTTADDRVALRESP = DirectCast(results(0), ATT_ADDR_VAL_RESP)
Catch soapException1 As System.Web.Services.Protocols.SoapException
Dim soapException As System.Web.Services.Protocols.SoapException = soapException1
log.writeLog("ADDRVAL_SOAPHTTPBinding", "97", SoapException.Detail)
Catch webException As System.Net.WebException
Dim ex As System.Net.WebException = webException
log.writeLog("ADDRVAL_SOAPHTTPBinding", "108", ex.Message)
End Try
Return aTTADDRVALRESP
Catch ex As Exception
System.Diagnostics.Debug.WriteLine(ex)
Dim log As New logger
log.writeLog("ADDRVAL_SOAPHTTPBinding", "113", ex)
End Try
So the question, anyone have an idea what would cause this, how to fix or troubleshoot this issue.