Stuck trying to install a certificate

OK, It's finished updates. I'm going start apache set the firewall for 80 and 443 and then backup (I use veeam).

Shouuld I use the same file for apache virtual host config as before?

Sure. As I understand you just want a cert. A simple VirtualHost is all that is needed. You could simplify debug by using this command rather than the one in your first post:

certbot certonly --webroot -w /var/www/html --agree-tos --staple-ocsp --email (redacted) -d hermes.corp.networkingtechnology.org
3 Likes

Exactly the same problem
Certbot failed to authenticate some domains (authenticator: webroot). The Certificate Authority reported these problems:
Domain: hermes.corp.networkingtechnology.org
Type: unauthorized
Detail: 79.132.230.61: Invalid response from https://hermes.corp.networkingtechnology.org/.well-known/acme-challenge/LgKhfO_uz4mdIXIQB8YsXkQxU5IiX47qzmgNSCjoSCU: 404

FYI, I checked my logs in the other Alma server with the forums: Dozens of 404 errors well-known/acme-challenge all with different strings after them. Not sure why they are on a different server?

Let's have a look at:
apachectl -t -D DUMP_VHOSTS

2 Likes

[root@hermes ~]# apachectl -t -D DUMP_VHOSTS
Passing arguments to httpd using apachectl is no longer supported.
You can only start/stop/restart httpd using this script.
If you want to pass extra arguments to httpd, edit the
/etc/sysconfig/httpd config file.

There's a HUGE letsencrypt error log. Do you want it?

Try
httpd -t -D DUMP_VHOSTS

2 Likes

you could try apache2ctl -t -D DUMP_VHOSTS

2 Likes

It worked before.
But that was on Hermes not hermes.

2 Likes

Maybe latest updates?
Previous server hostname was Hermes.corp.networkingtechnology.org This one is just hermes.

My tests to your server look identical to ones before. The curl request redirects from HTTP to HTTPS and the cert returned for HTTPS requests is just the corp.network... domain cert.

Can you show contents of the ssl.conf ?

And, the result of this:

curl -4 http://ifconfig.co
3 Likes
#
# When we also provide SSL we have to listen to the 
# standard HTTPS port in addition.
#
Listen 443 https

##
##  SSL Global Context
##
##  All SSL configuration in this context applies both to
##  the main server and all SSL-enabled virtual hosts.
##

#   Pass Phrase Dialog:
#   Configure the pass phrase gathering process.
#   The filtering dialog program (`builtin' is a internal
#   terminal dialog) has to provide the pass phrase on stdout.
SSLPassPhraseDialog exec:/usr/libexec/httpd-ssl-pass-dialog

#   Inter-Process Session Cache:
#   Configure the SSL Session Cache: First the mechanism 
#   to use and second the expiring timeout (in seconds).
SSLSessionCache         shmcb:/run/httpd/sslcache(512000)
SSLSessionCacheTimeout  300

#
# Use "SSLCryptoDevice" to enable any supported hardware
# accelerators. Use "openssl engine -v" to list supported
# engine names.  NOTE: If you enable an accelerator and the
# server does not start, consult the error logs and ensure
# your accelerator is functioning properly. 
#
SSLCryptoDevice builtin
#SSLCryptoDevice ubsec

##
## SSL Virtual Host Context
##

<VirtualHost _default_:443>

# General setup for the virtual host, inherited from global configuration
#DocumentRoot "/var/www/html"
#ServerName www.example.com:443

# Use separate log files for the SSL virtual host; note that LogLevel
# is not inherited from httpd.conf.
ErrorLog logs/ssl_error_log
TransferLog logs/ssl_access_log
LogLevel warn

#   SSL Engine Switch:
#   Enable/Disable SSL for this virtual host.
SSLEngine on

#   List the protocol versions which clients are allowed to connect with.
#   The OpenSSL system profile is used by default.  See
#   update-crypto-policies(8) for more details.
#SSLProtocol all -SSLv3
#SSLProxyProtocol all -SSLv3

#   User agents such as web browsers are not configured for the user's
#   own preference of either security or performance, therefore this
#   must be the prerogative of the web server administrator who manages
#   cpu load versus confidentiality, so enforce the server's cipher order.
SSLHonorCipherOrder on

#   SSL Cipher Suite:
#   List the ciphers that the client is permitted to negotiate.
#   See the mod_ssl documentation for a complete list.
#   The OpenSSL system profile is configured by default.  See
#   update-crypto-policies(8) for more details.
SSLCipherSuite PROFILE=SYSTEM
SSLProxyCipherSuite PROFILE=SYSTEM

#   Point SSLCertificateFile at a PEM encoded certificate.  If
#   the certificate is encrypted, then you will be prompted for a
#   pass phrase.  Note that restarting httpd will prompt again.  Keep
#   in mind that if you have both an RSA and a DSA certificate you
#   can configure both in parallel (to also allow the use of DSA
#   ciphers, etc.)
#   Some ECC cipher suites (http://www.ietf.org/rfc/rfc4492.txt)
#   require an ECC certificate which can also be configured in
#   parallel.
SSLCertificateFile /etc/pki/tls/certs/localhost.crt

#   Server Private Key:
#   If the key is not combined with the certificate, use this
#   directive to point at the key file.  Keep in mind that if
#   you've both a RSA and a DSA private key you can configure
#   both in parallel (to also allow the use of DSA ciphers, etc.)
#   ECC keys, when in use, can also be configured in parallel
SSLCertificateKeyFile /etc/pki/tls/private/localhost.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 convenience.
#SSLCertificateChainFile /etc/pki/tls/certs/server-chain.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)
#SSLCACertificateFile /etc/pki/tls/certs/ca-bundle.crt

#   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

#   Access Control:
#   With SSLRequire you can do per-directory access control based
#   on arbitrary complex boolean expressions containing server
#   variable checks and other lookup directives.  The syntax is a
#   mixture between C and Perl.  See the mod_ssl documentation
#   for more details.
#<Location />
#SSLRequire (    %{SSL_CIPHER} !~ m/^(EXP|NULL)/ \
#            and %{SSL_CLIENT_S_DN_O} eq "Snake Oil, Ltd." \
#            and %{SSL_CLIENT_S_DN_OU} in {"Staff", "CA", "Dev"} \
#            and %{TIME_WDAY} >= 1 and %{TIME_WDAY} <= 5 \
#            and %{TIME_HOUR} >= 8 and %{TIME_HOUR} <= 20       ) \
#           or %{REMOTE_ADDR} =~ m/^192\.76\.162\.[0-9]+$/
#</Location>

#   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 StrictRequire:
#     This denies access when "SSLRequireSSL" or "SSLRequire" applied even
#     under a "Satisfy any" situation, i.e. when it applies access is denied
#     and no other module can change it.
#   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 "/var/www/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 sent or allowed to be 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 sent 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-5]" \
         nokeepalive ssl-unclean-shutdown \
         downgrade-1.0 force-response-1.0

#   Per-Server Logging:
#   The home of a custom SSL log file. Use this when you want a
#   compact non-error SSL logfile on a virtual host basis.
CustomLog logs/ssl_request_log \
          "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"

</VirtualHost>

[root@hermes ~]# curl -4 http://ifconfig.co
85.234.199.231

That's my ISP's gateway for my /29 subnet. AND it has a PTR pointing to Alma-86 otherwise mail from my forums gets rejected by GMail for not having a PTR.

OK, and you are sure the DNS IP 79.132.230.61 routes to that IP?

Did you take your server down? Because ports 80 and 443 are closed for last few minutes.

2 Likes

There is no DocumentRoot defined.

3 Likes

Not in the port 443 VirtualHost. Port 80 does have one which we hope to use if we can ever isolate it. They shouldn't even need a port 443 VHost as they are just using a "dummy" http to get a cert for email. At least that's what I understand and that's what I was working toward.

There might be a DocumentRoot defined at the Server level

3 Likes

Then you need to stop the redirection first.

3 Likes

Agreed. But ports 80/443 are closed and has been for some time now. It went offline shortly after they described their IP address usage. Awaiting response

Will look for .htaccess and then maybe add DocumentRoot to that :443 host to see if that is the one responding. But, I don't think the DNS IP gets to that server. Or, they have some other architecture problem (competing servers still maybe).

3 Likes

I can talk to 22, 80 and 443 now.
networkingtechnology.org :white_check_mark:
hermes.networkingtechnology.org :white_check_mark:
corp.networkingtechnology.org 80, 443 answer - 22 is filtered.
hermes.corp.networkingtechnology.org 80, 443 answer - 22 is filtered.

EDIT:
I see two servers FWIW....

corp.networkingtechnology.org
Server: Apache/2.4.37 (AlmaLinux) OpenSSL/1.1.1k mod_fcgid/2.3.9
...
hermes.networkingtechnology.org
server: LiteSpeed
2 Likes

22 has been changed. One of the first things that I do. SELinux is disabled 2nd thing I do. Not sure where Lightspeed is coming from, all it has is a clean install GUI, Apache and the items needed for Certbot (see Linuxbabe installing Dovecot, There is NOTHING else on that server.
Only 80 and 443 were opened and 22 was changed.
corp.networkingtechnology.org has a Certificate on the OTHER Alma server. Seems like LetsEncrypt doesn't like multiple servers in the same domain.

Has nothing to do with Let's Encrypt. I make a curl request to your domain I get this right now

curl -I http://hermes.corp.networkingtechnology.org
curl: (7) Failed to connect to hermes.corp.networkingtechnology.org port 80 after 123 ms: Connection refused

You would get the same if you tried accessing that URL in a browser from outside your network (like with a cell phone with wifi off).

Here is what nmap looks like right now:

Nmap scan report for hermes.corp.networkingtechnology.org (79.132.230.61)
rDNS record for 79.132.230.61: 79.132.230.61.static.edpnet.net
Not shown: 991 filtered ports
PORT     STATE  SERVICE
21/tcp   open   ftp
25/tcp   open   smtp
80/tcp   closed http
81/tcp   open   hosts2-ns
110/tcp  open   pop3
143/tcp  closed imap
443/tcp  closed https
995/tcp  closed pop3s
3306/tcp open   mysql
3 Likes