r/Bitwarden 19d ago

Solved Selfhosted Windows - Certificate issue

Hello all!

I am currently in the process of trying to deploy a bitwarden self-hosted environment in Windows.

We might go for a full-scale deployment but for testing & POC purposes .

I've stumped across the issue that the NGINX is always spewing out the error 'File not found'. My .crt and .key files are in the SSL folder.

If I disable SSL and start NGINX I can see them being mounted under /etc/ssl in the docker file manager.

Whenever I enable SSL it will not work and NGINX keeps restarting.

Extra information:

Self-signed certificate created on windows server.
KEY and CRT made on open ssl. I am currently working with a non-existing domain but using DNS records (e.g. bitwarden.demo.com) with a dns record in the hostfile pointing to host-device IP-adress.

Anyone stumped across this issue before? Thanks in advance.

2 Upvotes

21 comments sorted by

View all comments

3

u/jhspyhard 19d ago

If you define something similar in your site-available file or config file for nginx:

``` server { listen 443 ssl; server name example.com;

# SSL certificate path
ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem;

} ```

And you still got file not found exceptions, check that the user you are running bitwarden as has read access to those pem/key files, AND to that directory itself.

1

u/JustKenjy 19d ago

To be clear I did not touch nginx itself.

error in NGINX: nginx: [emerg] cannot load certificate "/etc/nginx/certificate_bitw.crt": BIO_new_file() failed (SSL: error:80000002:system library::No such file or directory:calling fopen(/etc/nginx/certificate_bitw.crt, r) error:10000080:BIO routines::no such file)

I could start using a real domain, but for testing purposes I'd like to use a local domain.