mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2026-04-25 17:25:57 +03:00
[GH-ISSUE #340] ROCKET_TLS with Letsencrypt #191
Labels
No labels
SSO
Third party
better for forum
bug
bug
documentation
duplicate
enhancement
future Vault
future Vault
future Vault
good first issue
help wanted
low priority
notes
pull-request
question
troubleshooting
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/vaultwarden#191
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @barqers on GitHub (Jan 15, 2019).
Original GitHub issue: https://github.com/dani-garcia/vaultwarden/issues/340
I'm unable to point ROCKET_TLS to letsencrypt cert files without getting errors below:
[2019-01-15 14:11:38][rocket::config::error][ERROR] environment variable ROCKET_TLS='{certs=/ssl/cert.pem,key=/ssl/privkey.pem}' could not be parsed [2019-01-15 14:11:38][_][INFO] expected EOF but found { (eof) Logger failed to initialize: attempted to set a logger after the logging system was already initialized Logger failed to initialize: attempted to set a logger after the logging system was already initializedI've tried certs as cert.pem and fullchain.pem and key as privkey.pem and priv-fullchain-bundle.pem which all produce the same errors.
@dani-garcia commented on GitHub (Jan 15, 2019):
Did you check https://github.com/dani-garcia/bitwarden_rs/wiki/Enabling-HTTPS?
There is a problem with some cert applications that use symlinks, this might be related.
@barqers commented on GitHub (Jan 15, 2019):
I did - I've checked all symlinks and there is at least read access for all owner/users/other.
@mprasil commented on GitHub (Jan 15, 2019):
Are you running bitwarden_rs in container?
@barqers commented on GitHub (Jan 15, 2019):
I am running bitwarden_rs via docker. Http was working fine. But considering I gave read access to other I should be able to have the docker container read the symlinked files. There was two locations pointing to the actual pem files.
@dani-garcia commented on GitHub (Jan 15, 2019):
Not sure why that would fail, then. Make sure you are using the same format, quotes an all, just in case:
-e ROCKET_TLS='{certs="/path_to_ssl/cert.pem",key="/path_to_ssl/privkey.pem"}'.Other than that, I'm not sure.
@mprasil commented on GitHub (Jan 15, 2019):
Maybe try to
docker exec -ti bitwarden /bin/bash -c 'ls -la /ssl/'to see if the symlinks resolve properly inside the container.@barqers commented on GitHub (Jan 15, 2019):
Hmm so I'm using quotes, this is my -e ROCKET_TLS='{certs=/ssl/fullchain.pem,key=/ssl/privkey.pem}'
/ssl/ is mapped to the link to the folder with the symlinks. And the symlinks resolve properly using the exec command above showing -> to the proper files. I also tried linking the docker container straight to the files the symlinks are resolving to but that does not work either. I mean I could give read and write access to these files to see if it works but I'd rather not mess with the permissions on the pem files above read-level access. Any more thoughts?
@killuminiiiou commented on GitHub (Feb 5, 2019):
Hello @barqers,
Did you manage to fix this issue? I'm currently encountering a similar behavior trying to setup bitwarden-rs on a Synology NAS, using Docker and Let's Encrypt certificates...
I get the same error you are mentioning when using:
ROCKET_TLS='{certs=/ssl/fullchain.pem,key=/ssl/privkey.pem}'Removing the simple quotes around brackets seems to solve the issue for me (using Syno Docker UI). Container seems to start and run correctly.
But :
Trying to access the subdomain I configured in nginx to access bitwarden, I get the following error in bw logs:
Looking at nginx error log, I see:
So at this point, I'm not sure if the issue comes from bw or my server configuration. I have other sites configured on same server and domain, and everything is running fine.
If anyone has any thoughts, please let me know!
Thanks!
@BlackDex commented on GitHub (Feb 6, 2019):
what happens if you connect to the bitwarden docker ip via https, bypassing nginx? Does that work without errors, besides maybe not being valid.
also, how do you have nginx configured to connect to bwrs?
Via a proxy pass? Did you also set the proxy_ssl_verify to off? http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_ssl_verify
@killuminiiiou commented on GitHub (Feb 7, 2019):
Hey @BlackDex, thanks for your help!
When trying to bypass nginx (I mean trying to access directly the container using https://nas_ip:container_port), I get the same error as above in bwrs logs. So I would guess there is an issue with my certificate (using chrome, ERR_SSL_PROTOCOL_ERROR is returned, saying the site can't provide a secure connection).
And yes, I'm using a proxy pass to connect to bwrs in nginx. I didn't have the option proxy_ssl_verify specified to off, I gave it a shot but still getting the same error. I'll continue investigating and keep you updated.
Thanks!
@killuminiiiou commented on GitHub (Feb 7, 2019):
I found the issue... As I tried many configurations, container was pointing to a directory on the NAS where the certificates were stored, but using symlinks (which is not supported as the documentation states).
Now I'm able to connect to bwrs using https. Another issue seems to be happening:
I configured bwrs on my server on https://mysubdomain.mydomain.com/bwrs/. But it seems bwrs needs something like https://bwrs.mydomain.com to work properly (api is not reachable in the first configuration).
Thanks all for your help, I'm making progress now!
@BlackDex commented on GitHub (Feb 7, 2019):
@killuminiiiou, your welcome :). indeed running bitwarden on a sub-url is not possible at this point except when modifying the vault code as stated in #241
@mprasil commented on GitHub (Feb 13, 2019):
I'm going to close this as we haven't heard from @barqers for couple weeks, so hopefully this has been resolved, but feel free to re-open if issue persists.