Re: Could not create SSL/TLS Secure Channel

Faby
Helper

Could not create SSL/TLS Secure Channel

Hi,

   I am trying to ramp up with the API's and my starting point is to successfully run the Sample code in my local environment. I have downloaded C# Based sample Project.

   I am able to successfully compile the code but when i Run The sample test that are part of sample project i get an Exception "Could not create SSL/TLS secure channel."  I have created Certificate and downloaded Key's as mentioned in readme file of sample project.

    Following is my APP.Config file setting's. I have put dummy userid and password in this post but in my solution I have got them from my Dashboard.

    Attached i the screenshot of my commands i have used to create certificate file. And also the exception Message i am getting.

Not sure what am I missing. Any help is appreciable.

 

<?xml version="1.0" encoding="utf-8" ?>

<configuration>

<appSettings>

<add key="visaUrl" value="https://sandbox.api.visa.com/" />

 <add key="cert" value="C:\PERSONAL_PROJECTS\Sample\security\btest.p12" />

<add key="password" value="D6DzxA955R3dyV" />

 <add key="certPassword" value="SAAS_2011" />

<add key="userId" value="EIZD_NhwbrtXyafTXw" />

<add key="vctcTestPan" value="{put your pan number from test data under consumer rules api -> register a card here}" />

<add key="ClientSettingsProvider.ServiceUri" value="" />

</appSettings>

</configuration>

 

 

 

5 REPLIES 5
API_Products
Visa Developer Support Specialist

Re: Could not create SSL/TLS Secure Channel

Hello,

 

Thanks for being a Visa Developer Community contributor every time you post questions and solutions in the forum! 

 

To resolve the error, can you please create a new .p12 using the command line below.

Command line: openssl pkcs12 -export -out p12certfile.p12 -inkey example-key.pem -in cert.pem

 

After that, please try to call the helloworld method and see if you get a succesful response. If the error persists, please let me know what API you were trying to call and share your request header and snapshots of the error. 

 

Sincerely,

Diana




Thanks,

Tee



Was your question answered? Don't forget to click on "Accept as Solution" to help other devs find the answer to the same question.

Faby
Helper

Re: Could not create SSL/TLS Secure Channel

Hi Diana,

    I am not sure where is "Hello World" method. I have created a certificate using the command you have suggested but hte errors is still the same. I am not sure if i am missing something on my machine to configure TLS 1.2. I checked in registry i didn't find any entry for them. 

   The issue i am having is very basic. is there any prerequist's security settings that are required for the first time API user's. ? Or  do i need to Add  specific API's in my Dashboard before i can use them. 

 

Attached is the my Header and Command that i have used for creating certificate. 

API_Products
Visa Developer Support Specialist

Re: Could not create SSL/TLS Secure Channel

Hi,

Thanks for helping the Visa Developer Community every time you post questions and solutions to this forum! Are you still seeing the issue? I tooked a look at the image you attached to the community forum post and there are some edits that you should do (refer to Image 1). Here is how you can regenerate the .p12 file using the below command. You'll need to replace the 'Example' word with the file name (e.g. Example.p12 and key_Example.pem).

openssl pkcs12 -export -out Example.p12 -inkey key_Example.pem -in cert.pem

 

Could not Create SSL_TLS Secure Channel .pem photo2.png

Image 1

 

Could not Create SSL_TLS Secure Channel .pem photo.png

Image 2

 

Thank you,

Diana




Thanks,

Tee



Was your question answered? Don't forget to click on "Accept as Solution" to help other devs find the answer to the same question.

Faby
Helper

Re: Could not create SSL/TLS Secure Channel

Hi Diana,

    Thanks a ton for your reply. As suggest in your previouse post i followed the Getting started guide and Tested my Keystore,Usieid and password using SOAPUI and tested there validation with Helloworld API Call. It was successful. My Samll Win. 

    This means my Credentials are fine. I have used the same file App.Config file and still have the same issue with C# Sample code. 

 

   To take step further i downloaded a sample code for NODE.JS and i was able to run that sample code with success. 

 

   I want to use C# as my platform for development and i am not able to run that sample successfuly. 

   Can you please try the C# Sample on your machine and see if you have the same error. 

 

You help on this is Highly appriciated. 

 

Thanks 

 

API_Products
Visa Developer Support Specialist

Re: Could not create SSL/TLS Secure Channel

Hello,

 

Thanks for helping the Visa Developer Community every time you post questions and solutions to this forum!

 

Can you please let me know what APIs you are using for testing? In regards to your question about TLSv1.2, please follow this link - https://community.developer.visa.com/t5/Developer-Tools/Reducing-Risk-TLS-1-2-Mandatory-Upgrade-Deta... for TLS related questions. This link provides detailed information that you want to obtain about verification in our environment.

 

Also, to get started with code testing, please add specific APIs to your dashboard and follow the Getting Started with Visa Developer guide step-by-step and in the described specific order - https://developer.visa.com/vdpguide#get-started-overview

 

Please let us know if you have other questions.

 

Thank you,

Diana




Thanks,

Tee



Was your question answered? Don't forget to click on "Accept as Solution" to help other devs find the answer to the same question.