Reply
Member
Posts: 2
Registered: ‎10-04-2018
Accepted Solution

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()


Accepted Solutions
Solution
Accepted by topic author pcnerd911
‎10-13-2018 06:59 AM
Member
Posts: 5
Registered: ‎05-22-2016

Re: SSL/TLS Issue

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


All Replies
Solution
Accepted by topic author pcnerd911
‎10-13-2018 06:59 AM
Member
Posts: 5
Registered: ‎05-22-2016

Re: SSL/TLS Issue

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

Member
Posts: 2
Registered: ‎10-04-2018

Re: SSL/TLS Issue

Thanks I will try that.