Iām coding an API on a Symfony 5 project.
My requests works fine on my localhost server (GET and POST methods) but not on the production serveur.
Iāve tried a GET method URL on my production server, directly on url bar of Chrome browser, and It works fine.
Iām getting mad.
Does anyone can help me please ?
Hi @infoprogis
Are you able to provide more information about what you have tried?
Maybe screenshots and logs?
Thanks W4dd325 for your answer.
I can give you a simple GET query exemple. It returns a people list.
On my localhost server it works with Postman
In prod mode (same code but different server and DB) it works fine if I enter the API url in chrome
but not with postman
I donāt even understand where this error page come fromā¦ It seems to come from another website.
Use the capture requests feature with the Chrome Plugin\Interceptor.
Then try the get request in the browser and check the working request that gets recorded in Postman against your console log for the failed request.
Check the request and response, the body, the headers, etc. Make sure its actually setting any variables that you have in the request.
Hopefully you will find that something is different between the two requests that will help pin point the issue.
At a high level, that error is telling you that its hitting the server but canāt find the page rather than an authentication issue.
You really ought to parameterise your URL and passwords into environment variables.
Is your prod server using standard ports for https? 443?
Yes, the server uses the 443 port for https.
In the Postmanās console I noticed this warning : Hostname/IP does not match certificateās altnames
Maybe a DNS configuration ?
If I activate SSL verification I got this error : Error: Hostname/IP does not match certificateās altnames: Host: jardireport.jardiciel.eu. is not in the certās altnames: DNS:apple38.canadahost.ca, DNS:cpanel.apple38.canadahost.ca, DNS:cpcalendars.apple38.canadahost.ca, DNS:cpcontacts.apple38.canadahost.ca, DNS:mail.apple38.canadahost.ca, DNS:webmail.apple38.canadahost.ca, DNS:whm.apple38.canadahost.ca, DNS:www.apple38.canadahost.ca
Did you try and Google the error?
First hit I found advises to turn off SSL certificate verification.