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.
Could anyone please help with this?
Thanks,
Rama
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.
Looks like the certificate on the server is bad (has a different hostname). Talk to the responsible sysadmin.
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.
Maybe just use http:// instead of https:// can work
Thank you, but the issue has been resolved.
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.