简体   繁体   中英

ERR_SSL_PROTOCOL_ERROR when making request to server IP

I got a nodeJS express API /w enginx up and running on an ubuntu server. I've set up everything but when I try to access the API ( https://167.xx.xx.xx:80/get-all-products ) directly or through my client I get this error:

ERR_SSL_PROTOCOL_ERROR

I've did some searching and I found out that this could be because my server does not have a valid ssl certificate but for a ssl certificate I would need to have a domain / be the owner of the ip adress which I guess i'm not as the server is hosted by another company.

How can I fix this error without having to buy a domain for my server?

https://167.xx.xx.xx:80/... ...
I've did some searching and I found out that this could be because my server does not have a valid ssl certificate

This isn't the case here yet. The problem instead is that you are simply trying to switch from http:// on port 80 to https:// on port 80 without having the server setup for HTTPS. Thus the client will try to speak HTTPS while the server only understands HTTP - and this causes the failure you see.

To be able to use https:// in the URL you need to setup the server for this and the configuration must use a certificate which matches the URL (domain or IP) - no way around this.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM