Hello, I am trying to set up Let’s Encrypt on my Ubuntu 16.04 server, and I was sent here from Digital Ocean. I thought I installed and ran the right tutorial to install LE with nginx, when I was told I should have done the tutorial to install LE with apache. I am being told when I go to run the command:
The certificate is created successfully created, but I still get the warning that my server is not secure. My apache log also says (info is changed for security reasons):
[Thu Sep 21 15:13:57.319938 2017] [ssl:error] [pid 1577] AH02604: Unable to configure certificate
104.236.153.107:443:0 for stapling
[Thu Sep 21 15:13:57.321538 2017] [mpm_prefork:notice] [pid 1577] AH00163: Apache/2.4.18 (Ubuntu)
OpenSSL/1.0.2g configured -- resuming normal operations
[Thu Sep 21 15:13:57.321551 2017] [core:notice] [pid 1577] AH00094: Command line: '/usr/sbin/apache2'
[Thu Sep 21 15:14:03.543145 2017] [mpm_prefork:notice] [pid 1577] AH00171: Graceful restart requested, doing
restart
[Thu Sep 21 15:14:03.826324 2017] [ssl:warn] [pid 1577] AH01906: 104.236.153.107:443:0 server certificate is a CA
certificate (BasicConstraints: CA == TRUE !?)
[Thu Sep 21 15:14:03.830474 2017] [ssl:warn] [pid 1577] AH01909: 104.236.153.107:443:0 server certificate does
NOT include an ID which matches the server name
[Thu Sep 21 15:14:03.830899 2017] [ssl:error] [pid 1577] AH02217: ssl_stapling_init_cert: can't retrieve issuer
certificate! [subject: emailAddress=nickd@miyuholdings.com,O=MiYu Holdings\\, Inc.,L=Orem,ST=Utah,C=US /
issuer: emailAddress=nickd@miyuholdings.com,O=MiYu Holdings\\, Inc.,L=Orem,ST=Utah,C=US / serial:
C308F1E20C637C59 / notbefore: Sep 8 20:51:25 2017 GMT / notafter: Sep 8 20:51:25 2018 GMT]
I see that my logs are saying it can’t find my certificate, and that the server cert is not a CA cert. I had started the server using self-signed certificates, if that has anything to do with it. Thank you for any help you can provide.
It looks to me like your self-signed certificate is still in effect. Perhaps Certbot added an additional configuration in /etc/apache2/sites-enabled referring to the new Let’s Encrypt certificate, but it wouldn’t have removed your old configuration pointing to the self-signed certificate. You should do so yourself, either by switching everything to the new Certbot-created virtual host, or editing the configuration of your previous virtual host to point at the appropriate PEM files in /etc/letsencrypt/live.
Ok, thank you for helping me understand what is happening. After looking through my /etc/apache2/sites-enabled folder, I looked in the 000-default-le-ssl.conf file, and saw these 2 lines:
I would suggest disabling the self-signed certificate in the default-ssl.conf file.
Is there a reference to the domain name haracoin.com itself in the default-ssl.conf file? If you removed that reference, Apache would no longer think it should use the self-signed certificate in response to requests related to haracoin.com.
<IfModule mod_ssl.c>
<VirtualHost _default_:443>
ServerAdmin nickd@miyuholdings.com
ServerName 104.236.153.107
DocumentRoot /var/www/html
# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the loglevel for particular
# modules, e.g.
#LogLevel info ssl:warn
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
# For most configuration files from conf-available/, which are
# enabled or disabled at a global level, it is possible to
# include a line for only one particular virtual host. For example the
# following line enables the CGI configuration for this host only
# after it has been globally disabled with "a2disconf".
#Include conf-available/serve-cgi-bin.conf
# SSL Engine Switch:
# Enable/Disable SSL for this virtual host.
SSLEngine on
# A self-signed (snakeoil) certificate can be created by installing
# the ssl-cert package. See
# /usr/share/doc/apache2/README.Debian.gz for more info.
# If both key and certificate are stored in the same file, only the
# SSLCertificateFile directive is needed.
#SSLCertificateFile /etc/ssl/certs/apache-selfsigned.crt
#SSLCertificateKeyFile /etc/ssl/private/apache-selfsigned.key
# Server Certificate Chain:
# Point SSLCertificateChainFile at a file containing the
# concatenation of PEM encoded CA certificates which form the
# certificate chain for the server certificate. Alternatively
# the referenced file can be the same as SSLCertificateFile
# when the CA certificates are directly appended to the server
# certificate for convinience.
#SSLCertificateChainFile /etc/apache2/ssl.crt/server-ca.crt
# Certificate Authority (CA):
# Set the CA certificate verification path where to find CA
# certificates for client authentication or alternatively one
# huge file containing all of them (file must be PEM encoded)
# Note: Inside SSLCACertificatePath you need hash symlinks
# to point to the certificate files. Use the provided
# Makefile to update the hash symlinks after changes.
#SSLCACertificatePath /etc/ssl/certs/
#SSLCACertificateFile /etc/apache2/ssl.crt/ca-bundle.crt
# Certificate Revocation Lists (CRL):
# Set the CA revocation path where to find CA CRLs for client
# authentication or alternatively one huge file containing all
# of them (file must be PEM encoded)
# Note: Inside SSLCARevocationPath you need hash symlinks
# to point to the certificate files. Use the provided
# Makefile to update the hash symlinks after changes.
#SSLCARevocationPath /etc/apache2/ssl.crl/
#SSLCARevocationFile /etc/apache2/ssl.crl/ca-bundle.crl
# Client Authentication (Type):
# Client certificate verification type and depth. Types are
# none, optional, require and optional_no_ca. Depth is a
# number which specifies how deeply to verify the certificate
# issuer chain before deciding the certificate is not valid.
#SSLVerifyClient require
#SSLVerifyDepth 10
# SSL Engine Options:
# Set various options for the SSL engine.
# o FakeBasicAuth:
# Translate the client X.509 into a Basic Authorisation. This means that
# the standard Auth/DBMAuth methods can be used for access control. The
# user name is the `one line' version of the client's X.509 certificate.
# Note that no password is obtained from the user. Every entry in the user
# file needs this password: `xxj31ZMTZzkVA'.
# o ExportCertData:
# This exports two additional environment variables: SSL_CLIENT_CERT and
# SSL_SERVER_CERT. These contain the PEM-encoded certificates of the
# server (always existing) and the client (only existing when client
# authentication is used). This can be used to import the certificates
# into CGI scripts.
# o StdEnvVars:
# This exports the standard SSL/TLS related `SSL_*' environment variables.
# Per default this exportation is switched off for performance reasons,
# because the extraction step is an expensive operation and is usually
# useless for serving static content. So one usually enables the
# exportation for CGI and SSI requests only.
# o OptRenegotiate:
# This enables optimized SSL connection renegotiation handling when SSL
# directives are used in per-directory context.
#SSLOptions +FakeBasicAuth +ExportCertData +StrictRequire
<FilesMatch "\.(cgi|shtml|phtml|php)$">
SSLOptions +StdEnvVars
</FilesMatch>
<Directory /usr/lib/cgi-bin>
SSLOptions +StdEnvVars
</Directory>
# SSL Protocol Adjustments:
# The safe and default but still SSL/TLS standard compliant shutdown
# approach is that mod_ssl sends the close notify alert but doesn't wait for
# the close notify alert from client. When you need a different shutdown
# approach you can use one of the following variables:
# o ssl-unclean-shutdown:
# This forces an unclean shutdown when the connection is closed, i.e. no
# SSL close notify alert is send or allowed to received. This violates
# the SSL/TLS standard but is needed for some brain-dead browsers. Use
# this when you receive I/O errors because of the standard approach where
# mod_ssl sends the close notify alert.
# o ssl-accurate-shutdown:
# This forces an accurate shutdown when the connection is closed, i.e. a
# SSL close notify alert is send and mod_ssl waits for the close notify
# alert of the client. This is 100% SSL/TLS standard compliant, but in
# practice often causes hanging connections with brain-dead browsers. Use
# this only for browsers where you know that their SSL implementation
# works correctly.
# Notice: Most problems of broken clients are also related to the HTTP
# keep-alive facility, so you usually additionally want to disable
# keep-alive for those clients, too. Use variable "nokeepalive" for this.
# Similarly, one has to force some clients to use HTTP/1.0 to workaround
# their broken HTTP/1.1 implementation. Use variables "downgrade-1.0" and
# "force-response-1.0" for this.
BrowserMatch "MSIE [2-6]" \
nokeepalive ssl-unclean-shutdown \
downgrade-1.0 force-response-1.0
</VirtualHost>
</IfModule>
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
so I did a search by doing /haracoin.com and nothing came up, so I assume not
After messing with some things, I did a tail of the apache2 error log, and this is what came up:
[Thu Sep 21 17:40:55.497230 2017] [ssl:warn] [pid 5882] AH01909: 104.236.153.107:443:0 server certificate does
NOT include an ID which matches the server name
[Thu Sep 21 17:40:55.562173 2017] [ssl:warn] [pid 5883] AH01909: 104.236.153.107:443:0 server certificate does
NOT include an ID which matches the server name
[Thu Sep 21 17:40:55.572829 2017] [mpm_prefork:notice] [pid 5883] AH00163: Apache/2.4.18 (Ubuntu)
OpenSSL/1.0.2g configured -- resuming normal operations
[Thu Sep 21 17:40:55.572890 2017] [core:notice] [pid 5883] AH00094: Command line: '/usr/sbin/apache2'
[Thu Sep 21 17:45:45.087015 2017] [mpm_prefork:notice] [pid 5883] AH00169: caught SIGTERM, shutting down
It appears to have found the cert, but cannot match the ID to the server name. I assume it means the server name in the default-ssl.conf file, or somewhere else?
It is in the same location in /etc/apache2/sites-enabled/000-default.conf which was created when I ran certbot, but can’t remember if it was during the self-signed or the letsencrypt proccess
@schoen, users shouldn’t have to do anything special before using Certbot if they have a cert (self-signed or otherwise) that they want to replace with an LE cert.
Fun fact: If Certbot’s Apache plugin is asked to install a cert when the user only has non-TLS vhosts for a domain, we first create a TLS version of the vhost using dummy cert and key directives before the code that installs the cert is run. The actual deployment code just replaces the cert and key directives found in the vhost!
Thank you all for the help, but I am still experiencing the same problem. Is there any solutions that you guys can think of to help fix it? I hate to bother you guys about it, but my company wants to release this site to the public today and I need it to not says that the site is secure.
Something is performing the redirect; some directive in your conf files, some directive in .htaccess files in your document root or even your own wordpress installation.
1.- Directive in your conf files:
grep -Eri '(Redirect|RewriteRule)' /etc/apache2/
2.- Directive in your .htaccess files (change /tmp by the document root you are using for that domain in the apache conf):
Glad it works but as far as I can see, it works partially, it only works if you try to access your site with haracoin.com (http or https, both work) but www.haracoin.com redirects to the ip yet.
Also, did you change your WordPress conf? Because all your links, images, etc, still point to the ip, I don't use WordPress so I don't know if you need to perform any other change.
I just noticed that. I updated my site url and wordpress url and I am going through and updating pictures. Thank you for pointing that out and helping me finalize my site!