Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8691239
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T00:04:56+00:00 2026-06-13T00:04:56+00:00

I am trying to use cURL to post to an API that just started

  • 0

I am trying to use cURL to post to an API that just started using SNI (so they could host multiple ssl certs on 1 IP address).

My cURL stopped working as a result of this move to SNI. They explained that it’s because cURL is getting *.domain-a.com back instead of *.domain-b.com so the SSL fails.

This seems to be a bug in cURL because the API URL has no errors when visited from a browser.

Using this code, it does work:

exec('curl -k -d "parameters=here", https://urlhere.com/', $output);
print_r($output);

However, using -k is bad because it doesn’t verify the SSL cert.

Using this code, does NOT work:

exec('curl -d "parameters=here", https://urlhere.com/', $output);
print_r($output);

So my question is, how can I use curl with SNI and still verify the SSL (not have to use -k). Is there another setting in PHP or a cURL option I can set to work around this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T00:04:57+00:00Added an answer on June 13, 2026 at 12:04 am

    To be able to use SNI, three conditions are required:

    • Using a version of Curl that supports it, at least 7.18.1, according to the change logs.
    • Using a version of Curl compiled against a library that supports SNI, e.g. OpenSSL 0.9.8j (depending on the compilation options some older versions).
    • Using TLS 1.0 at least (not SSLv3).

    Note that Curl’s debug code (-v) only displays the major version number (mainly to distinguish between SSLv2 and SSLv3+ types of messages, see ssl_tls_trace), so it will still display “SSLv3” when you use TLS 1.0 or above (because they’re effectively SSL v3.1 or above, 3 is the same major version number).

    You could check that your installed version of curl can use SNI using Wireshark. If you make a connection using curl -1 https://something, if you expand the “Client Hello” message, you should be able to see a “server_name” extension.

    I’m not sure which SSL/TLS version is used by default (depending on your compilation options) when you use curl without -1 (for TLS 1.0) or -3 (for SSLv3), but you can try to force -1 on your command, since it won’t work with SSLv3 anyway.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Ok, I'm trying to use jQuery $.post with the PasteBin API to create a
I'm trying to use the PHP Curl library to connect to Experian's API. When
I'm trying to use cURL to post data to the form on this URL:
I'm trying to use cURL to post data to the form on this URL:
I am trying to log in to Tumblr using Curl, Below curl post logins
I am trying to use cURL to automate a login with multiple steps involved.
I am trying to use Curl to communicate with the API of a server:
I am trying to use cURL and SimpleHtmlDom to post a 13-digit value and
I'm trying to use curl to post data to a script which is posted
I have application that received data via HTTP POST requests. I'm trying to use

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.