Skip to content

Unable to use symlinks as value for CERT_FILE/KEY_FILE settings #11406

Closed
@ghost

Description

  • Gitea version (or commit ref): 1.11.5
  • Git version: 2.11.0
  • Operating system: Debian 4.9.210-1 x86_64
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • [X ] SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • [X ] Not relevant
  • Log gist:

Description

The server has the settings to use HTTPS:

[server]
...
PROTOCOL          = https
ROOT_URL          = https://<My domain>
CERT_FILE         = /etc/letsencrypt/live/<My Path>/fullchain.pem
KEY_FILE          = /etc/letsencrypt/live/<My Path>/privkey.pem

The fullchain.pem is a link to the file /etc/letsencrypt/archive/<My Path>/fullchain3.pem
The privkey.pem is a link to the file /etc/letsencrypt/archive/<My Path>/privkey3.pem

I have got an error:
server.go:107:ListenAndServeTLS() [E] Failed to load https cert file /etc/letsencrypt/live/<My Path>/fullchain.pem for tcp:0.0.0.0:3000: open /etc/letsencrypt/live/<My Path>/fullchain.pem: permission denied

In fact permissions are correct:

Case 1: Error. I have an error "... permission denied."
CERT_FILE = /etc/letsencrypt/live/<My Path>/fullchain.pem
CERT_FILE = /etc/letsencrypt/live/<My Path>/privkey.pem

Case 2: Success. No errors and everything is fine.
CERT_FILE = /etc/letsencrypt/archive/<My Path>/fullchain3.pem
CERT_FILE = /etc/letsencrypt/archive/<My Path>/privkey3.pem

Imo the call ioutil.ReadFile(certFile) is unable to read the symlinks.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions