SSL certificate problem: unable to get local issuer certificate , when use https apache proxy and Let's Encrypt certificate #1255

Closed
opened 2025-11-02 03:54:21 -06:00 by GiteaMirror · 4 comments
Owner

Originally created by @nikitos1881 on GitHub (Nov 17, 2017).

  • Gitea version (or commit ref): 1.2.3
  • Git version: 2.14.2
  • Operating system: windows 7
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • [x ] No
    • Not relevant
  • Log gist:

Description

I use Letsencrypt (https://letsencrypt.org/) free certificate and apache proxy. When I clone repoisitory have error "SSL certificate problem: unable to get local issuer certificate".
If modify app.ini to use https with optionts CERT_FILE and KEY_FILE with way to Lets encript certificate< i have "SSL certificate problem: unable to get local issuer certificate". In
bag_gitea

Screenshots

Originally created by @nikitos1881 on GitHub (Nov 17, 2017). - Gitea version (or commit ref): 1.2.3 - Git version: 2.14.2 - Operating system: windows 7 - Database (use `[x]`): - [ ] PostgreSQL - [x] MySQL - [ ] MSSQL - [ ] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [x ] No - [ ] Not relevant - Log gist: ## Description I use Letsencrypt (https://letsencrypt.org/) free certificate and apache proxy. When I clone repoisitory have error "SSL certificate problem: unable to get local issuer certificate". If modify app.ini to use https with optionts CERT_FILE and KEY_FILE with way to Lets encript certificate< i have "SSL certificate problem: unable to get local issuer certificate". In ![bag_gitea](https://user-images.githubusercontent.com/33552084/32957831-ccba5a14-cbcd-11e7-9e92-b172bf01b715.png) ## Screenshots <!-- **If this issue involves the Web Interface, please include a screenshot** -->
GiteaMirror added the type/question label 2025-11-02 03:54:21 -06:00
Author
Owner

@ModdyLP commented on GitHub (Nov 20, 2017):

You have not Setup Gitea Correctly with the reverse Proxy. Your SSH and Git Traffic to Gitea should always go through the Proxy.

[server]
DOMAIN = example.com
ROOT_URL = https://example.com/
HTTP_ADDR = localhost
HTTP_PORT = 3000
DISABLE_SSH  = false
SSH_PORT     = 22
OFFLINE_MODE = false
ENABLE_GZIP  = true
LANDING_PAGE = explore

Attention on HTTP_ADDR this should be localhost. I cant check the Apache Configuration, because i use NGINX as Reverse Proxy.

@ModdyLP commented on GitHub (Nov 20, 2017): You have not Setup Gitea Correctly with the reverse Proxy. Your SSH and Git Traffic to Gitea should always go through the Proxy. ``` [server] DOMAIN = example.com ROOT_URL = https://example.com/ HTTP_ADDR = localhost HTTP_PORT = 3000 DISABLE_SSH = false SSH_PORT = 22 OFFLINE_MODE = false ENABLE_GZIP = true LANDING_PAGE = explore ``` Attention on HTTP_ADDR this should be localhost. I cant check the Apache Configuration, because i use NGINX as Reverse Proxy.
Author
Owner

@nikitos1881 commented on GitHub (Nov 20, 2017):

I reconfigure Gitea config, but i get error "SSL certificate problem: unable to get local issuer certificate".

[server]
DOMAIN           = test.mydomain.com
SSH_DOMAIN       = test.mydomain.com
ROOT_URL         = https://test.mydomain.com:8445/
HTTP_ADDR        = localhost
HTTP_PORT        = 3001
PROTOCOL         = http
DISABLE_SSH      = false
SSH_PORT         = 22
OFFLINE_MODE     = false
ENABLE_GZIP      = true
LANDING_PAGE     = explore
LFS_START_SERVER = true
LFS_CONTENT_PATH = /var/gitea-lfs
LFS_JWT_SECRET   = axYPyopfcWlyVflTSZVSe6JoPYc5sTGmtGtTqjxzWYI

Apache config to work with SNI (https://wiki.apache.org/httpd/NameBasedSSLVHostsWithSNI) for local url https://test:8445 use local self-signet certificate, for internet url https://test.mydomain.com:8445/ use Letsencrypt certificate.
Letsencrypt certificate issued only on name test.mydomain.com

Apache config:

#Establish a connection for all virtual hosts for clients without SNI
SSLStrictSNIVHostCheck off

<VirtualHost *:8445>
    ServerName test:8445

	SSLEngine On
	SSLProxyEngine On
	SSlProtocol all
	SSLCipherSuite HIGH:MEDIUM
	
	# local self-signed certificate
	SSLCertificateFile /etc/ssl/test/server.crt
	SSLCertificateKeyFile /etc/ssl/test/server.key
	

# Revers proxy 

SSLProxyVerify none
SSLProxyCheckPeerCN off
#SSLProxyCheckPeerName off
SSLProxyCheckPeerExpire off
RequestHeader set Front-End-Https "On"

SSLProxyEngine 		On
ProxyRequests		Off
ProxyPreserveHost	On
AllowEncodedSlashes	NoDecode

<Proxy *>
    Order deny,allow
    Allow from all
</Proxy>


# Git Repository Gitea 
ProxyPass		    / http://localhost:3001/
ProxyPassReverse	/ http://localhost:3001/

</VirtualHost>

<VirtualHost *:8445>
    ServerName test.mydomain.com

    
    #Options Indexes ExecCGI FollowSymLinks

	SSLEngine on
	SSLProxyEngine On
	SSlProtocol all
	SSLCipherSuite HIGH:MEDIUM
	
	
	SSLCertificateFile /etc/ssl/zerossl/test.mydomain.com.crt
	SSLCertificateKeyFile /etc/ssl/zerossl/test.mydomain.com.key
	

# Revers proxy
SSLProxyEngine 		On
ProxyRequests		Off
ProxyPreserveHost	On
AllowEncodedSlashes	NoDecode

<Proxy *>
    Order deny,allow
    Allow from all
</Proxy>

# Git Repository Gitea
ProxyPass		    / http://localhost:3001/
ProxyPassReverse	/ http://localhost:3001/

</VirtualHost>
@nikitos1881 commented on GitHub (Nov 20, 2017): I reconfigure Gitea config, but i get error "SSL certificate problem: unable to get local issuer certificate". ``` [server] DOMAIN = test.mydomain.com SSH_DOMAIN = test.mydomain.com ROOT_URL = https://test.mydomain.com:8445/ HTTP_ADDR = localhost HTTP_PORT = 3001 PROTOCOL = http DISABLE_SSH = false SSH_PORT = 22 OFFLINE_MODE = false ENABLE_GZIP = true LANDING_PAGE = explore LFS_START_SERVER = true LFS_CONTENT_PATH = /var/gitea-lfs LFS_JWT_SECRET = axYPyopfcWlyVflTSZVSe6JoPYc5sTGmtGtTqjxzWYI ``` Apache config to work with SNI (https://wiki.apache.org/httpd/NameBasedSSLVHostsWithSNI) for local url https://test:8445 use local self-signet certificate, for internet url https://test.mydomain.com:8445/ use Letsencrypt certificate. Letsencrypt certificate issued only on name test.mydomain.com Apache config: ``` #Establish a connection for all virtual hosts for clients without SNI SSLStrictSNIVHostCheck off <VirtualHost *:8445> ServerName test:8445 SSLEngine On SSLProxyEngine On SSlProtocol all SSLCipherSuite HIGH:MEDIUM # local self-signed certificate SSLCertificateFile /etc/ssl/test/server.crt SSLCertificateKeyFile /etc/ssl/test/server.key # Revers proxy SSLProxyVerify none SSLProxyCheckPeerCN off #SSLProxyCheckPeerName off SSLProxyCheckPeerExpire off RequestHeader set Front-End-Https "On" SSLProxyEngine On ProxyRequests Off ProxyPreserveHost On AllowEncodedSlashes NoDecode <Proxy *> Order deny,allow Allow from all </Proxy> # Git Repository Gitea ProxyPass / http://localhost:3001/ ProxyPassReverse / http://localhost:3001/ </VirtualHost> <VirtualHost *:8445> ServerName test.mydomain.com #Options Indexes ExecCGI FollowSymLinks SSLEngine on SSLProxyEngine On SSlProtocol all SSLCipherSuite HIGH:MEDIUM SSLCertificateFile /etc/ssl/zerossl/test.mydomain.com.crt SSLCertificateKeyFile /etc/ssl/zerossl/test.mydomain.com.key # Revers proxy SSLProxyEngine On ProxyRequests Off ProxyPreserveHost On AllowEncodedSlashes NoDecode <Proxy *> Order deny,allow Allow from all </Proxy> # Git Repository Gitea ProxyPass / http://localhost:3001/ ProxyPassReverse / http://localhost:3001/ </VirtualHost> ```
Author
Owner

@silverwind commented on GitHub (Nov 30, 2017):

You're probably missing a SSLCertificateChainFile setting in your apache config.

@silverwind commented on GitHub (Nov 30, 2017): You're probably missing a `SSLCertificateChainFile` setting in your apache config.
Author
Owner

@lafriks commented on GitHub (Nov 30, 2017):

Closing as unrelated to gitea and also as answered

@lafriks commented on GitHub (Nov 30, 2017): Closing as unrelated to gitea and also as answered
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#1255