cancel
Showing results for 
Search instead for 
Did you mean: 

SSL/TLS Issue

I have a VB.Net application that has been using authorize.net for years. When they made the change for TLS I had to do some recoding. It seems to work most of the time, but recently customers have been complaining about the frequency of failures to authorize. I looked at the errors and I am seeing this a lot. 

 

I'm not sure why this is so sporadic. Any suggestions would help.

 

The request was aborted: Could not create SSL/TLS secure channel.

 

Here is the code that I am using.

ApiOperationBase(Of ANetApiRequest, ANetApiResponse).RunEnvironment = Global.AuthorizeNet.Environment.PRODUCTION

'define the merchant information (authentication / transaction id)
Dim merchantAuthType As New merchantAuthenticationType() With {
.name = MyLogin,
.ItemElementName = ItemChoiceType.transactionKey,
.Item = MyTranKey
}
ApiOperationBase(Of ANetApiRequest, ANetApiResponse).MerchantAuthentication = merchantAuthType

Dim creditCard = New creditCardType()
creditCard.cardNumber = CCNum
creditCard.expirationDate = ExpDate

Dim billingAddress = New customerAddressType()
billingAddress.firstName = tbFirstOnCard.Text
billingAddress.lastName = tbLastOnCard.Text
billingAddress.zip = tbCCZip.Text

'standard api call to retrieve response
Dim paymentType = New paymentType()
paymentType.Item = creditCard

 

Dim transactionRequest = New transactionRequestType()
transactionRequest.transactionType = transactionTypeEnum.authCaptureTransaction.ToString()
transactionRequest.amount = Replace(lblTotal.Text, "$", "")
transactionRequest.merchantDescriptor = "My Order"
transactionRequest.payment = paymentType
transactionRequest.billTo = billingAddress

Dim request = New createTransactionRequest()
request.transactionRequest = transactionRequest

'instantiate the controller that will call the service
Dim controller = New createTransactionController(request)
controller.Execute()

pcnerd911
Member
1 ACCEPTED SOLUTION

Accepted Solutions

Before your controller.execute put this line of code to force TLS 1.2:

 

ServicePointManager.SecurityProtocol = CType(3072, SecurityProtocolType)

 

in C#:

 

ServicePointManager.SecurityProtocol = (SecurityProtocolType)3072;

 

-pcmatt@IDP.Net

View solution in original post

pcmatt
Member
2 REPLIES 2

Before your controller.execute put this line of code to force TLS 1.2:

 

ServicePointManager.SecurityProtocol = CType(3072, SecurityProtocolType)

 

in C#:

 

ServicePointManager.SecurityProtocol = (SecurityProtocolType)3072;

 

-pcmatt@IDP.Net

pcmatt
Member

Thanks I will try that.