DATA Step, Macro, Functions and more

How to avoid SSL error while using https API call using filename url or proc http procedure?

Accepted Solution Solved
Reply
New Contributor
Posts: 4
Accepted Solution

How to avoid SSL error while using https API call using filename url or proc http procedure?

Hi All,

 

I am using SAS9.4 M0 version, trying to get data using api call.

 


filename test url "https://webaddress-dev/api/users/username-ab123"
user='login' pass=password;

data test_achive;
infile testlength=len lrecl=32767;
input line $varying32767. len;
run;

 

or 

filename resp "C:\Users\rkv897\Documents\test.xml";

proc http
method="GET"
url="https://webaddress-dev/api/users/username-ab123"
out=resp
WEBPASSWORD="password"
WEBUSERNAME="login";

run;

 

ERROR: SSL Error: Invalid subject name in partner's certificate. Subject name must match
machine name.

 

In both cases, I am able getting same SSL error. I can get the information in xml format when I enter the same address on the web browser, I do have to override the certificate error.

I have exported the certificate into base64 encoding and converted into .jks file using below command in command prompt.


d:\SAS\Applications\SASPrivateJavaRuntimeEnvironment\9.4\jre\bin>keytool -importcert -file "C:\Users\dcb123\Documents\webcertificate.cer" -keystore "C:\Users\dcb123\Documents\keystorefile.jks" -alias "anything"

 

I found some information about proc https connection 

http://support.sas.com/documentation/cdl/en/proc/61895/HTML/default/viewer.htm#a003286920.html

Using Hypertext Transfer Protocol Secure (HTTPS)

"C:\Program Files\SAS\SASFoundation\9.2\sas.exe" -CONFIG
"C:\Program Files\SAS\SASFoundation\9.2\nls\en\SASV9.CFG"
-jreoptions (- Djavax.net.ssl.trustStore=C:\Documents and
Settings\mydir\.keystore
-Djavax.net.ssl.trustStorePassword=trustpassword)

 

Added the keystorefile.jks as keystore location and password I entered while running the command in the configuration file SASv9.CFG .

 

Still, I got same error.

 

I got some information from this link too but it doesn't work for SAS9.4 M0.

http://documentation.sas.com/?docsetId=secref&docsetTarget=n12033intelplatform00install.htm&docsetVe...

 

Could anyone please help with this?

 

Thanks,

Rama

 

 

 


Accepted Solutions
Solution
‎12-13-2017 06:55 PM
New Contributor
Posts: 4

Re: How to avoid SSL error while using https API call using filename url or proc http procedure?

Posted in reply to KurtBremser

Thanks @KurtBremser

 

I was not using the host name the certificate was issued too. As I entered the domain in the api call , there was no error. I can get the data using proc http.

 

https://webaddress-dev.domainname.com/api/users/username-ab123

 

"Everything looks fine" For some of the data I have to solve Multi byte character issue when reading the xml file.

View solution in original post


All Replies
Super User
Posts: 9,553

Re: How to avoid SSL error while using https API call using filename url or proc http procedure?

Looks like the certificate on the server is bad (has a different hostname). Talk to the responsible sysadmin.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
How to convert datasets to data steps
How to post code
Solution
‎12-13-2017 06:55 PM
New Contributor
Posts: 4

Re: How to avoid SSL error while using https API call using filename url or proc http procedure?

Posted in reply to KurtBremser

Thanks @KurtBremser

 

I was not using the host name the certificate was issued too. As I entered the domain in the api call , there was no error. I can get the data using proc http.

 

https://webaddress-dev.domainname.com/api/users/username-ab123

 

"Everything looks fine" For some of the data I have to solve Multi byte character issue when reading the xml file.

New Contributor
Posts: 2

Re: How to avoid SSL error while using https API call using filename url or proc http procedure?

Maybe just use http://  instead of https://  can work

New Contributor
Posts: 4

Re: How to avoid SSL error while using https API call using filename url or proc http procedure?

Thank you, but the issue has been resolved.

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 4 replies
  • 307 views
  • 0 likes
  • 3 in conversation