BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Rama_V
Obsidian | Level 7

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

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Rama_V
Obsidian | Level 7

Thanks @Kurt_Bremser

 

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

4 REPLIES 4
Rama_V
Obsidian | Level 7

Thanks @Kurt_Bremser

 

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.

getright
Calcite | Level 5

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

Rama_V
Obsidian | Level 7

Thank you, but the issue has been resolved.

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

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