Connection refused after installing DSM 6.0 Beta

After installing the newly released DSM 6.0 beta for Synology NAS, I was unable to reach the DSM again. My Chrome browser showed “Connection refused”. Not really a good start for beta testing new software. connection-refused

Luckily SSH is still up. Since DSM running on nginx, it’s straightforward to look for some error log in the nginx error log.

1
$ cat /var/log/nginx/error.log

shows following log records

1
2015/10/14 21:08:31 [emerg] 9040#9040: PEM_read_bio_X509_AUX("/usr/syno/etc/ssl/ssl.chain.crt/server.crt") failed (SSL: error:0906D066:PEM routines:PEM_read_bio:bad end line)

in the file /usr/syno/etc/ssl/ssl.chain.crt/server.crt I found a weird certificate formatting

1
2
3
4
5
6
...
ImqVevbi0ntIdiu3OBL0NuuHNw7N1kKkXTBIZnswp3mxOVSqDrEchULLW8fyawVX
lBOEu1QErxKSjwvlkQ==
-----END CERTIFICATE----------BEGIN CERTIFICATE-----
MIIF2TCCA8GgAwIBAgIHFxU9nqs/vzANBgkqhkiG9w0BAQsFADB9MQswCQYDVQQG
...

There’s a missing newline between the chained certificate. Put a new line between the certificate and restart nginx.

1
2
3
4
5
6
7
...
ImqVevbi0ntIdiu3OBL0NuuHNw7N1kKkXTBIZnswp3mxOVSqDrEchULLW8fyawVX
lBOEu1QErxKSjwvlkQ==
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE-----
MIIF2TCCA8GgAwIBAgIHFxU9nqs/vzANBgkqhkiG9w0BAQsFADB9MQswCQYDVQQG
...

and restart nginx

1
$ synoservicecfg --restart nginx

Tadaaaa… DSM is available again.