Restricting Server or Curl from Getting Data of a Page or IP

azadhussnain

Well-Known Member
May 28, 2020
66
0
6
India
cPanel Access Level
Root Administrator
Hello, i want to know how can i restrict my server or curl to access a url through https

I want to restrict Example Domain , and then when i run this command in ssh :-
curl Example Domain
then I will get this output :
curl: (51) Unable to communicate securely with peer: requested domain name does not match the server's certificate.

and if i use php to get contents of that page via
file_get_contents("Example Domain");
then i will get this error :-
file_get_contents(): Peer certificate CN=`' did not match expected CN=`example.com

I seen this in a server, i wanted to know how can i do this
 
Last edited by a moderator:

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
16,643
2,629
363
cPanel Access Level
Root Administrator
Hey there! I don't completely understand the question. Tools like curl will only interpret the information they are provided, so I would expect that you would manually need to enter "curl Domain.com" in order to make a secure connection. The same thing would be happening in the PHP code, as the "https" portion of the URL will need to be manually added.