Newsroom Update

Beginning in May, a special Today at Apple series titled “Made for Business” will offer small business owners and entrepreneurs free opportunities to learn how Apple products and services can support their growth and success. Learn more >

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Hosting a secure website - Diffie-Hellmann weak ephemeral error msg

I am trying to host a website from my home using OS X Server as a small test project for me and my family, but I cannot redirect the site to its secure SSL version. From a Firefox browser outside my network, I get a weak ephemeral Diffie-Hellman key error message.

I already have a PositiveSSL Certificate verified from COMODO services installed.

The normal (http) version of the works fine when I remove the SSL options.

Can anyone tell me how to solve this problem?

iMac, OS X El Capitan (10.11)

Posted on Oct 11, 2015 6:07 AM

Reply
7 replies

Oct 11, 2015 6:34 AM in response to zazabor

The weak-DH warning is due to to the local Apache configuration. There are technical details of the issue available. There's also information on how to test for and how to address this; you'll be manually editing the Apache configuration files, pending an Apple update that eliminates the lower-grade crypto from the defaults. There are other discussions posted on this weak-DH "Logjam" error, as well as tools that can help generate the Apache configuration for you.


The OS X Server Apache configuration files are located under

/library/server/web/config/apache2

/library/server/web/config/apache2/sites

With the core httpd.conf analog file at

/library/server/web/config/apache2/httpd_server_app.conf

Hopefully, Apple will soon update the SSL/TLS security of Apache.

If not serving the web server data publicly, then I'd consider establishing a VPN into your network, and not serving pages openly. That'll cut down on the numbers of attempted server attacks and the rest of the dreck that will inevitably target any Internet-connected server; they'll have to get past the VPN authentication first.

Consider having your server separate from the other systems on your local network; configured into what is known as a DMZ. This is intended to contain any server breaches. With the DMZ, a server breach can be (and should be) prevented from further access into your network, meaning only the data on the server(s) in the DMZ is potentially exposed. Consider not having sensitive data on the server that's publicly accessible, as well. (If some part of a web site on your server is running php or Python or other such, and that becomes breached, then — depending on the severity of the breach, or the exposed access credentials, or such — the rest of the data on the server can potentially become exposed, and can be copied or deleted or otherwise corrupted. Best to isolate and separate, if you can.)

DMZ support is a feature of most mid-range and higher gateway-router-firewall-NAT devices; starting on the order of US$200 or so. Those firewalls can also have a VPN server, which means you have access to your entire network, once you've configured and established a VPN.

And FWIW, if you're running a local server for just your own clients and not for other folks on the Internet, there's no need for a purchased certificate. You can run your own CA and load your own root certificate into the clients that are using the site, or otherwise just mark the generated (local) certificate as being trusted by the client. Commercial certs provide no security advantages over that of a locally-managed CA, other than having the root certificate already loaded into the client; the trusted root certificate is securely pre-loaded. If you have control over the local clients, you can securely load your own root certificate. If you're serving ecommerce or serving potentially-sensitive data to random folks and particularly to client browsers that you do not control (and thus cannot securely load the root certificate or otherwise trust a generated certificate), then you do want a commercial certificate.

Oct 11, 2015 9:23 AM in response to MrHoffman

Thank you for your detailed reply MrHoffman.


I was already mucking around the web for details on the Diffie-Hellmann error message and, as you correctly pointed out to me, I found the post on the LogJam issue/vulnerability. In fact, as given specified on this page here, I have even generated a 2048-bit group using:


openssl dhparam -out dhparams.pem 2048


However, I do not know now how to use the command line interface of the OS X Server to include the newly generated "dhparams.pem" and then reload the configurations.

That is why I am stuck. I have to find out how to incorporate the new 2048-bit keys in the server.


(Regarding the issue with the local network and self.signed certificates, I cannot do that because I need my server website to be accessible over the internet, although via a username-passphrase credential system. So that local network is not an option for me.)


I do hope that Apple soon updates its Server App. (They did resolve other aspects of the LogJam vulnerabilities with Yosemite coreTLS).

Oct 11, 2015 10:10 AM in response to zazabor

You're running a server now, which means some familiarity with Terminal.app and the command line will eventually be beneficial; whether that's for customizations or for troubleshooting.


Per this discussion, find the certificates you are using in the Sites subdirectory (referenced by SSLCertificateFile), and append the DH to the end of the certificate file.


Launch Terminal.app from Applications > Utilities.


The $ is the command prompt in the following. Don't type it.


First, set your default directory to the Sites subdirectory.


$ cd /Library/Server/Web/Config/apache2/sites/


Then search for the certificate file names:


$ grep -i SSLCertificateFile *


will return some hits, and which should look something like this:


/Library/Server/Web/Config/apache2/sites/0000_any_443_.conf: SSLCertificateFile "/etc/certificates/{yourhostname.example.net}.{hexadecimal string}.cert.pem"


To append your DH to the end of the certificate file, something akin to the following two commands, where the first creates a backup copy and the second appends the dhparam file (shown as /your/path/to/the/custom/dhparam) onto the end of the certificate PEM file.


$ cp /etc/certificates/{yourhostname.example.net}.{hexadecimal string}.cert.pem ~/backup_copy_of_cert.pem

$ cat /your/path/to/the/custom/dhparam >> /etc/certificates/{yourhostname.example.net}.{hexadecimal string}.cert.pem


If there are other certificate files, you'll need to cp to back up those, and then cat to append the dhparam.


I've not tested this sequence as I don't have a Server.app 5 configuration handy.


Internet accessibility has nothing to do with privately-generated certificates. Certificates are certificates, whether the most massively expensive and beautiful mathematics of a top-drawer certificate from the premier vendor of exclusive certificates, or a home-grown certificate. So long as they all track back to a trusted certificate or a trusted root certificate — the certificate authority root certificate, whether commercial or your own — they all work the same, for the same bit-length certificates. It's getting the root certificate loaded into the clients that matters; that is central to the discussion. If you have control over your devices and of those others that will be using and accessing your site, a private CA works just the same as a public one. And you have more control and more flexibility. If you don't have control over the other accessing devices, then do purchase a commercial cert if you want or need SSL/TLS. CAs are selling you the presence of their root certificate in the trusted-certificate stores of various devices, a promise that you've identified yourself to them and that they won't just generate a certificate for somebody else, and some math. The whole certificate system is pretty flimsy, when you understand it.

Oct 11, 2015 11:40 AM in response to MrHoffman

I have some experience with the terminal. The problem is not that really.


Appending the new dhparams.pem file to the existing certificates alone does not solve the problem. I also have to change the Apache configuration in /Library/Server/Web/Config/apache2/httpd_server.conf


And I cannot edit write to this file even after signing is as root (not "sudo" but really "su root"). [I had to enable the root user for this in the first place.]

Oct 11, 2015 12:50 PM in response to MrHoffman

Enabling the root user is not usually something I'd recommend.

I completely agree to this. I am extremely unsettled after "enabling" the root account on my mac.


However, since I used the "OS X Server" app to create my web server, this app apparently retains ownership and write powers to all configuration files related to the functioning of the server and almost anything that goes beyond the basic features made available in the GUI. In fact, even to append the newly generated "dhparams.pem" file to the previously exiting certificate, I had to "su root" in the shell. Normal sudo privileges are not sufficient for changing server configurations it seems.


As regards the editor, I have been a fan of VIM for 2-3 years now. I tried vim, MacVim and vi to try and edit the config files as root, but failed.

Haven't tried nano though I doubt that it makes a difference here.

Oct 11, 2015 1:11 PM in response to zazabor

I probably can't help any further here; you're off into areas and changes beyond what I'm familiar with.


That OS X Server wants to rewrite or overwrite the file is typical. That's the way that Server.app works.


I'd suggest using the Sites-related files for changes via the XML-level configuration, or maybe enable local overrides and use the overrides (.htaccess) file in the web site directory.

Hosting a secure website - Diffie-Hellmann weak ephemeral error msg

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.