I have the following problem. I try to create a .NET Core Web-API and a Vue-SPA frontend.
For this purpose I´m using Nginx as a server on my windows machine.
For this .NET generate a SSL-certificate for me. This was generated in the certmgr in the folder own certificates.
To generate the certificate for Nginx I exported this generated file and follow this guid to transform it.
https://blog.knoldus.com/easiest-way-to-setup-ssl-on-nginx-using-pfx-files/
So I got my cert.crt and cert.rsa. Both off them I am using for Ngnix. Everything work fine for the Web-API. But on the frontend i alway get the following error
sockjs.js?9be2:1605 GET https://192.168.178.145:8081/sockjs-node/info?t=1552754433422 net::ERR_CERT_COMMON_NAME_INVALID
So the webpack-dev-server have trouble to connect. But I dont figure out why. What I am doing wrong in this case?
This is my Nginx config
server {
listen 58000 ssl;
server_name localhost;
ssl_certificate domain.crt;
ssl_certificate_key domain.rsa;
ssl_session_cache shared:SSL:1m;
ssl_session_timeout 5m;
ssl_ciphers HIGH:!aNULL:!MD5;
ssl_prefer_server_ciphers on;
location / {
#proxy_buffering off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
proxy_set_header X-NginX-Proxy true;
proxy_pass https://localhost:8081/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
location /api {
proxy_pass https://127.0.0.1:5001;
}
}
And in my webpack-dev-server I am using the following
module.exports = {
devServer: {
https: {
key: fs.readFileSync('path\\domain.rsa'),
cert: fs.readFileSync('path\\domain.crt'),
}
}
}
So it´s for me it´s look like that there are some issues with the certificate. But why is it only failing on the websockets and not on the rest?
Sorry I´m new to SSL and Nginx.