<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Accept Self-signed certificate with PROC HTTP in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Accept-Self-signed-certificate-with-PROC-HTTP/m-p/755971#M80812</link>
    <description>&lt;P&gt;Some tweaks to the way you transcribed the cURL to PROC HTTP:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="sas"&gt;proc http url="&amp;amp;server_host/&amp;amp;server_endpoint_token"
    in="%nrstr(&amp;amp;grant_type)=password%nrstr(&amp;amp;username)=user"
    webusername="client"
    webpassword="clientsecret"
    CT="application/x-www-form-urlencoded"
    out=jsonout
    headerout=headout;
	debug level=3;
    headers "Accept"="application/json" ;
run;&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;If you share more about which service you're using (if it's something common), we might have a better example.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;the IN= takes what you specify in cURL -d option. The webusername/webpassword takes what you specify in the -u option. CT= is shorthand for "Content-Type" so no need to include the "Content-Type=" as part of the value.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The&lt;A href="https://go.documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/proc/n154smey890g2xn1l6wljfyjcemh.htm" target="_self"&gt; SSLPARMS statement&amp;nbsp;&lt;/A&gt;can help specify behavior for verifying certificates. Adding the &lt;A href="https://go.documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/secref/p04x46b2ixjswen1u03bvv437x25.htm" target="_self"&gt;SSLREQCERT= value&lt;/A&gt; may help.&lt;/P&gt;
&lt;P&gt;Something like:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;sslparms "sslreqcert"="allow";&lt;/PRE&gt;</description>
    <pubDate>Thu, 22 Jul 2021 15:21:21 GMT</pubDate>
    <dc:creator>ChrisHemedinger</dc:creator>
    <dc:date>2021-07-22T15:21:21Z</dc:date>
    <item>
      <title>Accept Self-signed certificate with PROC HTTP</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Accept-Self-signed-certificate-with-PROC-HTTP/m-p/755964#M80811</link>
      <description>&lt;P&gt;Hi there, I'm trying to translate this code into SAS code with &lt;STRONG&gt;PROC HTTP&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;curl --insecure -k  https://server/oauth/token -H "Accept: application/json" -H "Content-Type: application/x-www-form-urlencoded" -d "grant_type=password&amp;amp;username=user&amp;amp;password=xxxx" -u client:clientsecret"&lt;/PRE&gt;&lt;P&gt;So far, I have this SAS code&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;proc http url="&amp;amp;server_host/&amp;amp;server_endpoint_token"&lt;BR /&gt;    in=jsonin&lt;BR /&gt;    webusername="client"&lt;BR /&gt;    webpassword="clientsecret"&lt;BR /&gt;    CT="Content-Type=application/x-www-form-urlencoded"&lt;BR /&gt;    out=jsonout&lt;BR /&gt;    headerout=headout;&lt;BR /&gt;	debug level=3;&lt;BR /&gt;    headers "Accept"="application/json" ;&lt;BR /&gt;run;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;The problem is that I have to accept the &lt;STRONG&gt;self-signed certificate&lt;/STRONG&gt; but I don't know how to implement that in the PROC HTTP procedure.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does someone know how to do that?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Jul 2021 14:49:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Accept-Self-signed-certificate-with-PROC-HTTP/m-p/755964#M80811</guid>
      <dc:creator>valengvz</dc:creator>
      <dc:date>2021-07-22T14:49:37Z</dc:date>
    </item>
    <item>
      <title>Re: Accept Self-signed certificate with PROC HTTP</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Accept-Self-signed-certificate-with-PROC-HTTP/m-p/755971#M80812</link>
      <description>&lt;P&gt;Some tweaks to the way you transcribed the cURL to PROC HTTP:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="sas"&gt;proc http url="&amp;amp;server_host/&amp;amp;server_endpoint_token"
    in="%nrstr(&amp;amp;grant_type)=password%nrstr(&amp;amp;username)=user"
    webusername="client"
    webpassword="clientsecret"
    CT="application/x-www-form-urlencoded"
    out=jsonout
    headerout=headout;
	debug level=3;
    headers "Accept"="application/json" ;
run;&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;If you share more about which service you're using (if it's something common), we might have a better example.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;the IN= takes what you specify in cURL -d option. The webusername/webpassword takes what you specify in the -u option. CT= is shorthand for "Content-Type" so no need to include the "Content-Type=" as part of the value.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The&lt;A href="https://go.documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/proc/n154smey890g2xn1l6wljfyjcemh.htm" target="_self"&gt; SSLPARMS statement&amp;nbsp;&lt;/A&gt;can help specify behavior for verifying certificates. Adding the &lt;A href="https://go.documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/secref/p04x46b2ixjswen1u03bvv437x25.htm" target="_self"&gt;SSLREQCERT= value&lt;/A&gt; may help.&lt;/P&gt;
&lt;P&gt;Something like:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;sslparms "sslreqcert"="allow";&lt;/PRE&gt;</description>
      <pubDate>Thu, 22 Jul 2021 15:21:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Accept-Self-signed-certificate-with-PROC-HTTP/m-p/755971#M80812</guid>
      <dc:creator>ChrisHemedinger</dc:creator>
      <dc:date>2021-07-22T15:21:21Z</dc:date>
    </item>
    <item>
      <title>Re: Accept Self-signed certificate with PROC HTTP</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Accept-Self-signed-certificate-with-PROC-HTTP/m-p/755974#M80813</link>
      <description>&lt;P&gt;I'm using your code but it seems like there is a problem with the credentials, this is the way I created the &lt;STRONG&gt;jsonin&lt;/STRONG&gt; file, I already correct the PROC HTTP statement as well&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;filename jsonin temp lrecl=32760;&lt;BR /&gt;filename jsonout temp lrecl=32760;&lt;BR /&gt;filename headout temp lrecl=32760;&lt;/PRE&gt;&lt;PRE&gt;
%let string= 'grant_type=password&amp;amp;username=client&amp;amp;password=xxxx';

data _null_;
	call symputx('FLEN', length(&amp;amp;string));
run;

data _null_;
	file jsonin recfm=F lrecl=&amp;amp;FLEN;
	put &amp;amp;string;
run;


proc http url="&amp;amp;server_host/&amp;amp;server_endpoint_token"
    in=jsonin
    webusername="client"
    webpassword="cleintsecret"
    CT="application/x-www-form-urlencoded"
    out=jsonout
    headerout=headout;
	debug level=3;
    headers "Accept"="application/json" ;
run;

&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Jul 2021 15:46:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Accept-Self-signed-certificate-with-PROC-HTTP/m-p/755974#M80813</guid>
      <dc:creator>valengvz</dc:creator>
      <dc:date>2021-07-22T15:46:59Z</dc:date>
    </item>
    <item>
      <title>Re: Accept Self-signed certificate with PROC HTTP</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Accept-Self-signed-certificate-with-PROC-HTTP/m-p/755977#M80814</link>
      <description>Why not skip creating the file and just put the literal value in the IN=, at least for now? Your value (which isn't JSON anyway) might have extra quotes from your %LET statement.</description>
      <pubDate>Thu, 22 Jul 2021 16:00:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Accept-Self-signed-certificate-with-PROC-HTTP/m-p/755977#M80814</guid>
      <dc:creator>ChrisHemedinger</dc:creator>
      <dc:date>2021-07-22T16:00:28Z</dc:date>
    </item>
    <item>
      <title>Re: Accept Self-signed certificate with PROC HTTP</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Accept-Self-signed-certificate-with-PROC-HTTP/m-p/755981#M80815</link>
      <description>Thank you so much, it works for now!</description>
      <pubDate>Thu, 22 Jul 2021 16:10:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Accept-Self-signed-certificate-with-PROC-HTTP/m-p/755981#M80815</guid>
      <dc:creator>valengvz</dc:creator>
      <dc:date>2021-07-22T16:10:10Z</dc:date>
    </item>
  </channel>
</rss>

