In some place I wrote that "However the very same API is returning proper 
result with both --- IP address and domain name". I would like to correct 
hat this scenario is working when I am hitting the API from POSTMAN.

On Friday, November 10, 2017 at 5:15:20 PM UTC+5:30, Rahul Paul wrote:
>
> Hi, 
>
> I am using requests package to send a post request to an API within my 
> application.
>
> I am using the request as : 
>
> *requests.post("https://xx.xxx.xxx.xxx/my-admin/api/api2 
> <https://xx.xxx.xxx.xxx/my-admin/api/api2>", data=data)*
>
> where "xx.xxx.xxx.xxx" is the IP of my server on which this API is hosted.
>
> When I am trying to call this API from my application, django is raising 
> an  exception as follows:
>
> *SSLError: hostname 'xx.xxx.xxx.xxx' doesn't match 'xxx.com 
> <http://xxx.com>'*
>
> But when I put the domain name in the request i.e. "xxx.com", it gives me 
> proper result. Also when I put verify=False along with the request, my 
> application gives me proper result even with IP addess in the request. 
> However the very same API is returning proper result with both --- IP 
> address and domain name.
>
> My server has a CA signed certificate but the DNS have forward entry but 
> doesnot have a PTR entry. I have also verified with digicert.com and 
> found that when I am entering the domain name, it is giving proper IP 
> address but when I am giving IP address, it is not able to resolve the 
> domain name. 
>
> This API was functioning working correctly with IP address when we had 
> self signed certificate.
>
> Also I am using nginx-gunicorn to run my application.
>
> Please help me with understanding why this is happening and what are the 
> best possible solutions for this problem.
>
> Thanks in advance.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/f83f9682-4e7d-4ce9-95aa-67e6d6d4aff3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to