OPNsense Forum

Archive => 19.1 Legacy Series => Topic started by: MBfromOK on February 10, 2019, 04:08:49 am

Title: [Resolved] SSL + Routing Issues - Apache Config Problem
Post by: MBfromOK on February 10, 2019, 04:08:49 am
Quote
To start: Thanks everyone for your hard work on OPNSense, I moved from a XenServer host running distinct servers for DHCP, DNS, Firewall, and NextCloud to a ProxMox Host with just OPNSense (19.1.1) and NextCloud.

So much simpler to update and maintain, much easier to secure, looks so much nicer!

Network Details:
    VM Host: 2 NICs - 1 WAN, 1 LAN
        OPNSense (19.1.1) has 2 Virtual NICs - 1 WAN & 1 LAN running DHCP, DNS, NTP, and Firewall
        Webserver is Debian 9 running Apache 2.4.25 - 1 NIC, Internal Only 10.x.x.x IP

    Existing (internal) network was established with <mydomainname>.local when it was created 2 years ago, purchased <mydomainname>.space in the last 2 weeks.
    DNS is working and all servers are accessible internally from either their IP or DNS.

To the Issue at hand:
(mycloud.<mydomain>.space or www.<mydomain>.space)

Error details:
Code: [Select]
This site can’t provide a secure connection mycloud.<mydomain>.space didn’t accept your login certificate, or one may not have been provided.
Try contacting the system admin.
ERR_BAD_SSL_CLIENT_AUTH_CERT

Advanced details:
This error refers to the OPNSense self signed certificate, though now I can't figure out where I saw that reflected.

~OR~

(<mydomain>.space)
Error details:
   
Code: [Select]
Your connection is not private
Attackers might be trying to steal your information from <mydomain>.space (for example, passwords, messages, or credit cards). Learn more
NET::ERR_CERT_COMMON_NAME_INVALID
   

Advanced details:
   
Code: [Select]
This server could not prove that it is <mydomain>.space; its security certificate is from mycloud.<mydomain>.space. This may be caused by a misconfiguration or an attacker intercepting your connection.
   

Any help the community can offer would be great, hoping to take this and make a how-to for the docs.
Title: Re: Routing, SSL, Forwarding, Aliases and NAT: Webpages & IoT devices
Post by: newsense on February 10, 2019, 04:23:05 am
The CN and/or SANs you're using on the public cert must match mycloud.mydomain.space in your example.

For public certs the SANs are what matters nowadays, so at the very least make sure your CN and SAN are defined as you can see in the forum.opnsense.org certificate.
Title: Re: Routing, SSL, Forwarding, Aliases and NAT: Webpages & IoT devices
Post by: newsense on February 10, 2019, 04:26:12 am
Also please edit your thread title to something that resembles SSL Issue - as it stands is highly misleading  ;)
Title: Re: Routing, SSL, Forwarding, Aliases and NAT: Webpages & IoT devices
Post by: MBfromOK on February 10, 2019, 04:26:50 am
I will check that I didn't get my certificates switched for the <mydomain).space error, what about the first one (where it seems that OPNSense is intercepting / not routing the address)?
Title: Re: Routing, SSL, Forwarding, Aliases and NAT: Webpages & IoT devices
Post by: MBfromOK on February 10, 2019, 04:37:30 am
The CN and/or SANs you're using on the public cert must match mycloud.mydomain.space in your example.

For public certs the SANs are what matters nowadays, so at the very least make sure your CN and SAN are defined as you can see in the forum.opnsense.org certificate.

Am I correct regarding the following?

Subject / CN = Common Name
SAN = Subject Alternative Name
Title: Re: SSL + Routing Issues
Post by: newsense on February 10, 2019, 06:05:10 am
That is correct. Note that you can have one or more SANs, most common being hostname + fqdn.
Title: Re: Routing, SSL, Forwarding, Aliases and NAT: Webpages & IoT devices
Post by: newsense on February 10, 2019, 06:15:09 am
Quote
what about the first one (where it seems that OPNSense is intercepting / not routing the address)?

Something doesn't add up here, you're mentioning port forwarding tutorials then asking about SSL intercept.

Which is the actual setup that you have in place right now ?
Title: Re: SSL + Routing Issues
Post by: MBfromOK on February 10, 2019, 08:01:53 am
DHCP Cable Internet connection with Port 80 blocked (ISP)

Dynamic DNS (EntryDNS) pointing to my dynamic Public IP Address with domain <mydomain>.space

I am trying to route <mydomain>.space to a webspace hosted by my internal webserver living at ip: 10.2.6.4 with the (current) hostname of mycloud.<mydomain>.local

When I try (from inside my private network) to access https://<mydomain>.space I get this error:
This site can’t provide a secure connection <mydomain>.space didn’t accept your login certificate, or one may not have been provided.
Try contacting the system admin.
ERR_BAD_SSL_CLIENT_AUTH_CERT

Digging through the error indicates that the issue is being caused by a self signed certificate.  The only certificates on this server are the Let's Encrypt certificates I created and the OPNSense WebGUI Certificate (self signed).  I mention ssl intercept because (opnsense.<mydomain>.local is applying its certificate to <mydomain>.space and I am talking about port forwarding because I am not sure if the issue is happening because forwarding is broken or OPNSense.
Title: Re: SSL + Routing Issues
Post by: newsense on February 10, 2019, 08:20:29 am
In short, neither opnsense nor port forwarding are "broken".

You seem to be a bit confused about how SSL actually works however. :)

What cert do you see connecting from outside to https://domain.space and what cert do you receive when connecting from inside to https://server_IP ?

Also, you can safely remove the OPNSense WEBGUI cert from that server, it's utterly irrelevant to the whole setup.
Title: [Closed] SSL + Routing Issues
Post by: MBfromOK on February 10, 2019, 05:03:30 pm
It would seem my Apache configuration was broken while trying to get certbot to validate my domain through the blocked http port (80).

The Resolution:
I removed, purged, and reinstalled apache, then restored my NextCloud instance and now the root domain, www domain, and cloud domain all load the correct certificate, but at the default document root.  I am working on that now.

To answer your question:I validated the certificate path and filenames for all three domains, revoked and reissued them multiple times, restarted the server and apache several times and couldn't resolve it.

As far as the unsigned OPNSense Certificate is concerned, it was created by OPNSense during the install; even though it is non-validated security, I don't think I will be taking your advice to remove it (unless I choose to give it a validated cert as well).

Thanks again for your time, sorry that it ended up not related to OPNSense after all... One thing these forums don't accurately reflect is the amount of time involved for the post creator. I was hitting my head on the wall for over 30 hours trying to figure the certificate error and routing issues before I started this post. This was created when (tunnel vision) seemed to indicate all roads pointed to OPNSense.