How to resolve SSLProtocol Syntax Error

H. Ferrence asked:

I am trying to install an SSL Certificate.

When I restart apache I get this error:

SSLProtocol: Illegal protocol ‘\xe2\x80\x93SSLv2’

Here are my conf file directives:

<VirtualHost *:443>
    ServerAlias *
    DocumentRoot /home/abc/public_html/
    SSLEngine on
    SSLProtocol all -SSLv2 -SSLv3
    SSLCertificateFile /etc/ssl/mycert_example_com_cert.cer
    SSLCertificateKeyFile /etc/ssl/mycert.key
    SSLCACertificateFile /etc/ssl/mycert_example_com_interm.cer
    ErrorLog logs/sites_error_log
    CustomLog logs/sites_access_log common


I resolved the error using @MichaelHampton’s catch on the hyphen.

Now when I restart apache the http service daemon does not start either with apachectl restart or apachectl stop and apache start

So I stepped through the directives, 1-by-1 commenting and uncommenting and the moment I uncomment SSLEngine on http does not restart.

So I wonder…this is the second container in the conf file. The first container also has an SSLEngine on directive. Do I need to repeat that directive in each container?

My answer:

Your configuration line doesn’t contain the expected hyphen (-). It instead contains an en dash (). It looks similar, but it’s a completely different character.

In fact, it appears both of them are en dashes.

This can happen if you copy and paste from a web site which has unhelpfully changed hyphens to en dashes.

To solve the problem, replace both of the en dashes with hyphens.

View the full question and any other answers on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.