Cannot load certificate

DK0005 error when starting DevKinsta.

When I check Docker error log on devkinsta_nginx container I see this.
nginx: [emerg] cannot load certificate “/www/kinsta/ssl/jmp-services.local.crt”: BIO_new_file() failed (SSL: error:02001002:system library:fopen:No such file or directory:fopen(‘/www/kinsta/ssl/jmp-services.local.crt’,‘r’) error:2006D080:BIO routines:BIO_new_file:no such file)

What can I do to resolve this?

Hello there @wpcreative-jw :wave:

From that error log you provided ( on your devkinsta_nginx container ), it seems that jmp-services.local.crt file somehow is missing from your local computer (though I’m not sure how it got removed/deleted or moved? from there).

To confirm, you may want to check inside your ~/DevKinsta/ssl/ sub-folder and see if that .crt file is not there? And see if it might be moved somewhere else perhaps (and if you can find it somewhere on your local computer, may want to move it back under that sub-folder, if possible? and try to re-open DevKinsta if that helps)

I was also able to replicate this error on my local computer.
First, I tried to rename the .crt file of my local site (renamed it with .bak extension):

:~/DevKinsta/ssl$ ll dfweb.local.*
-rwxrwxrwx 1 agus agus 1414 Nov 14 10:38 dfweb.local.crt.bak*
-rwxrwxrwx 1 agus agus 1698 Nov 14 10:38 dfweb.local.key*

after that, when I tried to open/start DevKinsta I got an error, and when I checked the docker error log on my devkinsta_nginx container, I also got the similar error message:

2022/12/06 00:31:04 [emerg] 1#1: cannot load certificate "/www/kinsta/ssl/dfweb.local.crt": BIO_new_file() failed (SSL: error:02001002:system library:fopen:No such file or directory:fopen('/www/kinsta/ssl/dfweb.local.crt','r') error:2006D080:BIO routines:BIO_new_file:no such file)
nginx: [emerg] cannot load certificate "/www/kinsta/ssl/dfweb.local.crt": BIO_new_file() failed (SSL: error:02001002:system library:fopen:No such file or directory:fopen('/www/kinsta/ssl/dfweb.local.crt','r') error:2006D080:BIO routines:BIO_new_file:no such file)

When I renamed that dfweb.local.crt.bak file back to dfweb.local.crt , I was able to load DevKinsta again.

So for this case, and once you confirm that jmp-services.local.crt file is missing from your ~/DevKinsta/ssl/ sub-folder (and can’t find it somewhere else), then you may want to try to re-generate it, with the following steps:

  1. cd ~/DevKinsta/ssl/

  2. type:
    openssl genrsa 2048 > jmp-services.local.key

  3. type:
    openssl req -new -x509 -nodes -sha256 -days 365 -key jmp-services.local.key -out jmp-services.local.crt

  4. It will prompt you with few questions and please answer them, with something like this for example:
    ===========================
    Country Name (2 letter code) [AU]:US
    State or Province Name (full name) [Some-State]:CA
    Locality Name (eg, city) :West Hollywood
    Organization Name (eg, company) [Internet Widgits Pty Ltd]:Kinsta
    Organizational Unit Name (eg, section) :DevKinsta
    Common Name (e.g. server FQDN or YOUR name) :jmp-services.local
    Email Address :
    ===========================
    Note: that the Common Name must be set with the actual site url (e.g: jmp-services.local )

  5. Once those files have been created, please also try to delete the devkinsta_nginx before reopening DevKinsta (via command line can be done with: docker rm -f devkinsta_nginx )

  6. Try to re-open DevKinsta and it should now no longer showing the error. Then you can test to access the site and make sure it’s working fine.

Please give it a try from your end and hopefully the above method will help to solve the issue.

Cheers,
Agus

That resolved the issue. Thanks!

1 Like

Thank you for the update! :slight_smile:
Glad to hear that resolved the issue! :+1:

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.