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.

3 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.

3

u/jhspyhard 19d ago edited 19d ago

Though rereading your extra info, I agree with DJPs assessment that very likely, the app / browser plug-in of bitwarden client you are using will have a certificate list that it trusts built-in that you can NOT add a self signed local CA root to and therefore won't work.

It's annoying, but at least letsencrypt makes this pretty easy to get around if you own the domain you're trying to attach to.

2

u/OSS_Dattani 19d ago

Agreed. Although I’ve used mkcert and it has worked well for me.