# How to use https with influx api call?

**URL:** <https://community.influxdata.com/t/how-to-use-https-with-influx-api-call/11045>\
**Category:** InfluxDB 2\
**Tags:** influxdb\
**Created:** [August 27, 2019, 10:49pm UTC](https://community.influxdata.com/t/how-to-use-https-with-influx-api-call/11045 "2019-08-27T22:49:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kevi](https://avatars.discourse-cdn.com/v4/letter/k/a88e57/32.png) [@Kevi](https://community.influxdata.com/u/Kevi)\
**Post date:** [August 27, 2019, 10:49pm UTC](https://community.influxdata.com/t/how-to-use-https-with-influx-api-call/11045/1 "2019-08-27T22:49:55Z")

</div>

Hi all  
I am currently working with influxdb and I’ve just added a self-signed certificate to enable https.  
I can still access my influxdb by typing something like this with the CLI tool: influx -ssl -unsafeSsl -host \<domain\_name\>.com  
However, I can’t seem to be able to figure out how this is possible with an api call?  
I am currently doing something similar to this in php, which worked before the addition of the certificate:  
$query = urlencode(‘SHOW MEASUREMENTS’);  
curl\_setopt($curl\_handle,CURLOPT\_URL,“[https://myhost/query?u=myuser&p=mypasswer&db=mydb&q=](https://myhost/query?u=myuser&p=mypasswer&db=mydb&q=)” . $query);

I can’t figure out what the alternative to -ssl and -unsafeSsl is in this format.

Thanks for your help

---

<div class="post-metadata">

**Author:** ![Rahul\_Kalita](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/rahul_kalita/32/4563_2.png) [@Rahul\_Kalita](https://community.influxdata.com/u/Rahul_Kalita)\
**Post date:** [September 15, 2020, 6:44pm UTC](https://community.influxdata.com/t/how-to-use-https-with-influx-api-call/11045/2 "2020-09-15T18:44:24Z")

</div>

Hi Kevi,  
I am running into the same problem. Did you figure this out?
