Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NGINX - Godaddy - ssl

Tags:

nginx

ssl

I am tying to use GoDaddy ssl with Nginx. I am having and issue getting this to work. Any help would be appreciated.

I did the following:

openssl req -new -newkey rsa:2048 -nodes -keyout img.example.com.key -out img.example.com.csr

Gave this to GoDaddy and requested a new cert.

Next I combined the two crt files into one.

Assuming your certificate file is called example.com.crt, use this command to create a combined file called example.com.chained.crt (replace the highlighted part with your own domain):

cat example.com.crt intermediate.crt > example.com.chained.crt

server_name example.com;
ssl_certificate /home/sammy/example.com.chained.crt;
ssl_certificate_key /home/sammy/example.com.key;

I am now seeing this error when I try to start Nginx:

sudo nginx -t

nginx: [emerg] SSL_CTX_use_PrivateKey_file("/etc/nginx/ssl-certs/img.example.com.key") failed (SSL: error:0906D06C:PEM routines:PEM_read_bio:no start line:Expecting: ANY PRIVATE KEY error:140B0009:SSL routines:SSL_CTX_use_PrivateKey_file:PEM lib)

Anyone know why I am getting this error?

Thanks Phil

like image 449
philipfwilson Avatar asked May 02 '17 03:05

philipfwilson


Video Answer


1 Answers

Had the same issue. Changing the encoding from UTF-8 to ANSI did work for me.

like image 103
Tobias Avatar answered Nov 16 '22 01:11

Tobias