<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">
<p style="margin-top:0;margin-bottom:0">Perfect thanks Liviu!</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">Jon</p>
<br>
<br>
<div style="color: rgb(0, 0, 0);">
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Users <users-bounces@lists.opensips.org> on behalf of Liviu Chircu <liviu@opensips.org><br>
<b>Sent:</b> 22 January 2018 12:55<br>
<b>To:</b> users@lists.opensips.org<br>
<b>Subject:</b> Re: [OpenSIPS-Users] rest_api request to HTTPS site with pem file</font>
<div> </div>
</div>
<div style="background-color:#FFFFFF">
<p><tt>Using exec() is definitely a viable solution. Moreover, you can even wrap it around an async() call, so you don't hinder the SIP throughput.</tt></p>
<p><tt><br>
Best regards,</tt><br>
</p>
<pre class="x_moz-signature" cols="72">Liviu Chircu
OpenSIPS Developer
<a class="x_moz-txt-link-freetext" href="http://www.opensips-solutions.com" id="LPlnk179210" previewremoved="true">http://www.opensips-solutions.com</a></pre>
<div id="LPBorder_GT_15166295554420.6670951169289345" style="margin-bottom: 20px; overflow: auto; width: 100%; text-indent: 0px;">
<table id="LPContainer_15166295554370.4628554287411799" role="presentation" cellspacing="0" style="width: 90%; background-color: rgb(255, 255, 255); position: relative; overflow: auto; padding-top: 20px; padding-bottom: 20px; margin-top: 20px; border-top: 1px dotted rgb(200, 200, 200); border-bottom: 1px dotted rgb(200, 200, 200);">
<tbody>
<tr valign="top" style="border-spacing: 0px;">
<td id="ImageCell_15166295554380.7632632853658055" colspan="1" style="width: 250px; position: relative; display: table-cell; padding-right: 20px;">
<div id="LPImageContainer_15166295554380.9535100941964785" style="background-color: rgb(255, 255, 255); height: 38px; position: relative; margin: auto; display: table; width: 116px;">
<a id="LPImageAnchor_15166295554380.1710274195177104" href="http://www.opensips-solutions.com/" target="_blank" style="display: table-cell; text-align: center;"><img id="LPThumbnailImageID_15166295554390.9542627630797154" width="116" height="38" style="display: inline-block; max-width: 250px; max-height: 250px; height: 38px; width: 116px; border-width: 0px; vertical-align: bottom;" src="http://www.opensips-solutions.com/imgs/opensips-solutions-logo.gif"></a></div>
</td>
<td id="TextCell_15166295554390.2006580327028138" colspan="2" style="vertical-align: top; position: relative; padding: 0px; display: table-cell;">
<div id="LPRemovePreviewContainer_15166295554390.8083316607375552"></div>
<div id="LPTitle_15166295554390.8412382894644268" style="top: 0px; color: rgb(0, 120, 215); font-weight: 400; font-size: 21px; font-family: wf_segoe-ui_light, "Segoe UI Light", "Segoe WP Light", "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif; line-height: 21px;">
<a id="LPUrlAnchor_15166295554400.533608614403817" href="http://www.opensips-solutions.com/" target="_blank" style="text-decoration: none;">Home — OpenSIPS Solutions</a></div>
<div id="LPMetadata_15166295554400.35421638419985535" style="margin: 10px 0px 16px; color: rgb(102, 102, 102); font-weight: 400; font-family: wf_segoe-ui_normal, "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif; font-size: 14px; line-height: 14px;">
www.opensips-solutions.com</div>
<div id="LPDescription_15166295554410.5632284001212788" style="display: block; color: rgb(102, 102, 102); font-weight: 400; font-family: wf_segoe-ui_normal, "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif; font-size: 14px; line-height: 20px; max-height: 100px; overflow: hidden;">
OpenSIPS is a mature Open Source implementation of a SIP server. OpenSIPS is more than a SIP proxy/router as it includes application-level functionalities.</div>
</td>
</tr>
</tbody>
</table>
</div>
<br>
<div class="x_moz-cite-prefix">On 22.01.2018 14:53, Jonathan Hunter wrote:<br>
</div>
<blockquote type="cite">
<div id="x_compose-container" itemscope="" itemtype="https://schema.org/EmailMessage" style="direction:ltr">
<span itemprop="creator" itemscope="" itemtype="https://schema.org/Organization"><span itemprop="name"></span></span>
<div>
<div style="direction:ltr">Hi Liviu,</div>
<div><br>
</div>
<div style="direction:ltr">Cool great news I will do that shortly on github and thanks for the response.</div>
<div><br>
</div>
<div style="direction:ltr">So in short term would you suggest I just look to execute my php script to fire the https request for the time being from within my opensips.cfg? </div>
<div><br>
</div>
<div style="direction:ltr">Many thanks</div>
<div><br>
</div>
<div style="direction:ltr">Jon </div>
<div><br>
</div>
<div class="x_acompli_signature">Get <a href="https://aka.ms/o0ukef">Outlook for iOS</a></div>
<div class="x_gmail_quote">_____________________________<br>
From: Liviu Chircu <<a dir="ltr" href="mailto:liviu@opensips.org">liviu@opensips.org</a>><br>
Sent: Monday, January 22, 2018 12:38 pm<br>
Subject: Re: [OpenSIPS-Users] rest_api request to HTTPS site with pem file<br>
To: <<a dir="ltr" href="mailto:users@lists.opensips.org">users@lists.opensips.org</a>><br>
<br>
<br>
<p><tt>Hi Jonathan,</tt></p>
<p><tt><br>
</tt></p>
<p><tt>Unfortunately, the rest_client module does not currently support custom SSL client certificates - you can only specify the "ssl_capath" in order to validate remote sites that you connect with. The good news is that adding this feature looks quite trivial
[1], so we may as well throw it onto the 2.4 TODO list. Please open up a GitHub feature request [2] for this, and we'll go from there.<br>
</tt></p>
<p><tt><br>
</tt></p>
<p><tt>Best regards,</tt></p>
<p><tt><br>
</tt></p>
<p><tt>[1]: <a class="x_moz-txt-link-freetext" href="https://curl.haxx.se/libcurl/c/simplessl.html">
https://curl.haxx.se/libcurl/c/simplessl.html</a><br>
[2]: <a class="x_moz-txt-link-freetext" href="https://github.com/OpenSIPS/opensips/issues">
https://github.com/OpenSIPS/opensips/issues</a><br>
</tt></p>
<pre class="x_moz-signature" cols="72">Liviu ChircuOpenSIPS Developer<a class="x_moz-txt-link-freetext" href="http://www.opensips-solutions.com">http://www.opensips-solutions.com</a></pre>
<div class="x_moz-cite-prefix">On 22.01.2018 14:07, Jonathan Hunter wrote:<br>
</div>
<blockquote type="cite">
<div id="x_divtagdefaultwrapper" dir="ltr" style="font-size:12pt; color:#000000; font-family:Calibri,Helvetica,sans-serif">
<p style="margin-top:0; margin-bottom:0">Hi guys,</p>
<p style="margin-top:0; margin-bottom:0"><br>
</p>
<p style="margin-top:0; margin-bottom:0">Sorry for this question!</p>
<p style="margin-top:0; margin-bottom:0"><br>
</p>
<p style="margin-top:0; margin-bottom:0">I am looking to send an https request using an ssl cert with the rest_client module, and Im not sure how to achieve this and if its possible?</p>
<p style="margin-top:0; margin-bottom:0"><br>
</p>
<p style="margin-top:0; margin-bottom:0">I have been testing with a php script which works fine using <span>stream_context_set_option($ctx, 'ssl', 'local_cert', $pemfilename); to associate the certificate but wondered instead of referencing an external script
I can just do the same using the rest_client?</span></p>
<p style="margin-top:0; margin-bottom:0"><span><br>
</span></p>
<p style="margin-top:0; margin-bottom:0"><span>I have setup SSL certs with the TLS module before, but not sure how to reference with the rest_client.</span></p>
<p style="margin-top:0; margin-bottom:0"><span><br>
</span></p>
<p style="margin-top:0; margin-bottom:0"><span>Do I just reference the .pem file within configuration file somewhere and add that as a rest_append_hf ?</span></p>
<p style="margin-top:0; margin-bottom:0"><span><br>
</span></p>
<p style="margin-top:0; margin-bottom:0"><span>Sorry if I have missed anything obvious.</span></p>
<p style="margin-top:0; margin-bottom:0"><span><br>
</span></p>
<p style="margin-top:0; margin-bottom:0"><span>Many thanks</span></p>
<p style="margin-top:0; margin-bottom:0"><span><br>
</span></p>
<p style="margin-top:0; margin-bottom:0"><span>Jon</span></p>
</div>
<br>
<fieldset class="x_mimeAttachmentHeader"></fieldset> <br>
<pre>_______________________________________________Users mailing list<a class="x_moz-txt-link-abbreviated" href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a><a class="x_moz-txt-link-freetext" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a></pre>
</blockquote>
<br>
<br>
<br>
</div>
</div>
</div>
<br>
<fieldset class="x_mimeAttachmentHeader"></fieldset> <br>
<pre>_______________________________________________
Users mailing list
<a class="x_moz-txt-link-abbreviated" href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a>
<a class="x_moz-txt-link-freetext" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
</pre>
</blockquote>
<br>
</div>
</div>
</div>
</body>
</html>