Contenu | Rechercher | Menus

Annonce

Si vous avez des soucis pour rester connecté, déconnectez-vous puis reconnectez-vous depuis ce lien en cochant la case
Me connecter automatiquement lors de mes prochaines visites.

À propos de l'équipe du forum.

#1 Le 13/01/2015, à 17:49

tuxrouge

Apache2 et SSL

Bonjour à vous

je suis débutant dans le domaine
J'ai installé ubuntu server avec apache2 configuré par défaut
l'objectif est de pouvoir m'en servir entre autre comme serveur de fichier et d'y installer owncloud par dessus.
En suivant la doc j'ai généré un certificat auto-signé

Lorsque je tente de me connecté à mon serveur à travers https j'ai le message suivant:

Échec de la connexion sécurisée

Une erreur est survenue pendant une connexion à 192.168.1.12. SSL a reçu un enregistrement qui dépasse la longueur maximale autorisée. (Code d'erreur : ssl_error_rx_record_too_long) 

du coup je ne sais que faire
je voudrai tout simplement pouvoir me connecter de manière sécurisé à mon serveur, y compris depuis l'extérieur (il est auto-hébergé, derrière une box)

Hors ligne

#2 Le 16/01/2015, à 01:32

le cinglé_001

Re : Apache2 et SSL

Bonjour.

Explique de quelle manière tu as généré le certificat.

Normalement la liste des commandes se trouvent dans l'historique du terminal.

#3 Le 16/01/2015, à 16:38

tuxrouge

Re : Apache2 et SSL

j'ai utilisé cette documentation:
http://doc.ubuntu-fr.org/tutoriel/secur … 2_avec_ssl

la commande fut donc:

sudo make-ssl-cert /usr/share/ssl-cert/ssleay.cnf /etc/ssl/private/localhost.pem

ça aide ?

Hors ligne

#4 Le 16/01/2015, à 20:44

le cinglé_001

Re : Apache2 et SSL

Bonsoir.

Oui ça aide.
J'avais eu le même problème en utilisant la méthode décrite dans la doc. Il faut que je regarde dans mon wiki pour voir comment j'avais résolu le problème.
Comme il est un peu bordélique ça va pas être facile de retrouver où j'ai mis la solution. big_smile

Je sais qu'il fallait inverser certaines commandes sur la 12.04 pour que ça fonctionne.

#5 Le 19/01/2015, à 17:31

tuxrouge

Re : Apache2 et SSL

argh, tu as pas retrouvé dans ton wiki magique ?
si ça se confirme va falloir penser à modifier la doc.

Tu sais comment je peux annuler cette clef ? toi ou un autre en fait.

Hors ligne

#6 Le 20/01/2015, à 12:00

le cinglé_001

Re : Apache2 et SSL

Bonjour.

Comme je n'ai pas mis la solution au propre alors que je croyais l'avoir fait et je n'ai pas eu le temps ce week-end de vérifier.
Je fais mes sauvegardes et je m'en occupe dans la journée.

#7 Le 20/01/2015, à 12:18

Compte anonymisé

Re : Apache2 et SSL

tuxrouge a écrit :

argh, tu as pas retrouvé dans ton wiki magique ?
si ça se confirme va falloir penser à modifier la doc.

Tu sais comment je peux annuler cette clef ? toi ou un autre en fait.

tu peux avoir autant de clés que tu le désires, si tu ne veux plus la voir, tu va dans son répertoire et rm ..

pour faire une clé et certificat auto-signé, je procède ainsi:  (exemple pour 365 jours)

cd /etc/ssl

openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout key.pem -out cert.pem

#8 Le 20/01/2015, à 12:54

le cinglé_001

Re : Apache2 et SSL

Bonjour sirius007.

Ce n'est pas le problème du nombre ou de pouvoir le supprimer mais plutôt de le générer et de ne pas avoir de message d'erreur. Lorsque je suis passé de la 10.04 à la 12.04 j'ai eu le même problème que tuxrouge, et je l'ai réglé en modifiant la liste des commandes sinon j'avais à chaque fois le même message d'erreur. wink

#9 Le 20/01/2015, à 13:42

le cinglé_001

Re : Apache2 et SSL

Tape dans cet ordre :

sudo service apache2 stop
sudo rm /etc/ssl/private/localhost.pem
sudo rm /etc/apache2/sites-available/ssl
sudo a2enmod ssl
sudo make-ssl-cert /usr/share/ssl-cert/ssleay.cnf /etc/ssl/private/localhost.pem
cd /etc/apache2/sites-available/
sudo cp default ssl
sudo sed -i '1,2s/\*:80/*:443/' ssl
sudo sed -i "3a\\\tSSLEngine On\n\tSSLCertificateFile /etc/ssl/private/localhost.pem" ssl
sudo a2ensite ssl
sudo service apache2 start

Normalement ça devrait fonctionner.

#10 Le 21/01/2015, à 10:51

tuxrouge

Re : Apache2 et SSL

merci pour ces réponses

par contre, the_boss j'ai un pb avec la commande

sudo cp default ssl
cp: cannot stat ‘default’: No such file or directory

faut dire que je n'ai pas de fichier ssl dans le répertoire mais des defaut-ssl.conf et 000-defaut.conf
c'est grave ?

Hors ligne

#11 Le 22/01/2015, à 05:53

le cinglé_001

Re : Apache2 et SSL

Bonjour.

Oui effectivement il me semble avoir lu que le nom du fichier avait changé sur les versions supérieures à la 12.04.
J'avais un peu testé Apache sur la 14.04 mais rapidement et je n'ai pas eu le temps de tout tester.

Poste le contenu de ces deux fichiers pour qu'on puisse voir comment adapter la commande.

Dernière modification par the_boss_oo1 (Le 22/01/2015, à 05:54)

#12 Le 22/01/2015, à 13:32

tuxrouge

Re : Apache2 et SSL

alors pour 000-defaut.conf:

<VirtualHost *:80>
	# The ServerName directive sets the request scheme, hostname and port that
	# the server uses to identify itself. This is used when creating
	# redirection URLs. In the context of virtual hosts, the ServerName
	# specifies what hostname must appear in the request's Host: header to
	# match this virtual host. For the default virtual host (this file) this
	# value is not decisive as it is used as a last resort host regardless.
	# However, you must set it for any further virtual host explicitly.
	#ServerName www.example.com

	ServerAdmin webmaster@localhost
	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
</VirtualHost>

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet

Pour default-ssl.conf

<IfModule mod_ssl.c>
	<VirtualHost _default_:443>
		ServerAdmin webmaster@localhost

		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/ssl-cert-snakeoil.pem
		SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.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
		# MSIE 7 and newer should be able to use keepalive
		BrowserMatch "MSIE [17-9]" ssl-unclean-shutdown

	</VirtualHost>
</IfModule>

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet

sinon j'ai aussi un owncloud.https

NameVirtualHost *:443
# Hte virtuel qui écoute sur le port HTTPS 443
<VirtualHost *:443>
DocumentRoot /var/www/owncloud
ServerName AROEVEN
# Activation du mode SSL
SSLEngine On
SSLOptions +FakeBasicAuth +ExportCertData +StrictRequire
# On indique ou est le certificat
SSLCertificateFile /etc/ssl/certs/owncloud.crt
SSLCertificateKeyFile /etc/ssl/private/owncloud.key
</VirtualHost>

et un owncloud-ssl.conf

Listen 3443 https
# Hote virtuel qui ecoute sur le port HTTPS 3443
<VirtualHost *:3443>
DocumentRoot /var/www/owncloud/
# Activation du mode SSL
SSLEngine On
SSLOptions +FakeBasicAuth +ExportCertData +StrictRequire
# On indique ou est le certificat
SSLCertificateFile /etc/ssl/certs/owncloud.crt
SSLCertificateKeyFile /etc/ssl/private/owncloud.key
</VirtualHost>

Hors ligne

#13 Le 22/01/2015, à 13:50

le cinglé_001

Re : Apache2 et SSL

Il semble que le fichier ont été changé

Regarde ce que cela donne avec
Tape dans cet ordre :

sudo service apache2 stop
sudo rm /etc/ssl/private/localhost.pem
sudo rm /etc/apache2/sites-available/default-ssl.conf
sudo a2enmod ssl
sudo make-ssl-cert /usr/share/ssl-cert/ssleay.cnf /etc/ssl/private/localhost.pem
cd /etc/apache2/sites-available/
sudo cp 000-defaut.conf  default-ssl.conf
sudo sed -i '1,2s/\*:80/*:443/' ssl
sudo sed -i "3a\\\tSSLEngine On\n\tSSLCertificateFile /etc/ssl/private/localhost.pem" ssl
sudo a2ensite ssl
sudo service apache2 start

Je pense qu'il pourrait y avoir un problème sur deux lignes mais regarde tout de même ce que cela donne. Tu ne risques rien

Dernière modification par the_boss_oo1 (Le 22/01/2015, à 13:51)

#14 Le 24/01/2015, à 12:07

tuxrouge

Re : Apache2 et SSL

alors, voilà où ça coince :

# sed -i '1,2s/\*:80/*:443/' ssl
sed: can't read ssl: No such file or directory

effectivement ce fichier n'existe pas. sed -i c'est pour le créer ?

Hors ligne

#15 Le 27/01/2015, à 17:42

tuxrouge

Re : Apache2 et SSL

personne n'a d'idée pour que je me sorte de ce mauvais pas ?

Hors ligne

#16 Le 28/01/2015, à 15:44

Compte anonymisé

Re : Apache2 et SSL

tu as essayé de générer les cles et certificats comme indiqués post7

que répond  sudo openssl x509 -text -noout -in "ton_certificat"

#17 Le 28/01/2015, à 17:14

tuxrouge

Re : Apache2 et SSL

alors oui j'avais fait la manip pour la génération du certificat
par contre je ne suis pas sûr du nom de mon certificat. J'ai essayé localhost.pem mais aussi key.pem ou default.pem, le résultat est similaire

# openssl x509 -text -noout -in localhost.pem
Error opening Certificate localhost.pem
139877173843616:error:02001002:system library:fopen:No such file or directory:bss_file.c:398:fopen('localhost.pem','r')
139877173843616:error:20074002:BIO routines:FILE_CTRL:system lib:bss_file.c:400:
unable to load certificate

Hors ligne

#18 Le 28/01/2015, à 17:43

Compte anonymisé

Re : Apache2 et SSL

tuxrouge a écrit :

alors oui j'avais fait la manip pour la génération du certificat
par contre je ne suis pas sûr du nom de mon certificat. J'ai essayé localhost.pem mais aussi key.pem ou default.pem, le résultat est similaire

# openssl x509 -text -noout -in localhost.pem
Error opening Certificate localhost.pem
139877173843616:error:02001002:system library:fopen:No such file or directory:bss_file.c:398:fopen('localhost.pem','r')
139877173843616:error:20074002:BIO routines:FILE_CTRL:system lib:bss_file.c:400:
unable to load certificate

il faut que tu exécutes cette commande dans le répertoire ou tu as mis la clé et certificat .., là il ne le trouve pas, si tu es bien dans le répertoire, le certificat n'existe pas...

peux tu lister ce répertoire avec   ls -l

Dernière modification par sirius007 (Le 28/01/2015, à 17:43)

#19 Le 28/01/2015, à 18:41

tuxrouge

Re : Apache2 et SSL

oui effectivement c'est mieux dans le dossier idoine

Le dossier en question est donc /etc/ssl
Il comprend:

/etc/ssl# ls
cert.pem  certs  key.pem  openssl.cnf  private

et un openssl x509 -text -noout -in key.pem donne

/etc/ssl# openssl x509 -text -noout -in key.pem 
unable to load certificate
140366370367136:error:0906D06C:PEM routines:PEM_read_bio:no start line:pem_lib.c:703:Expecting: TRUSTED CERTIFICATE

alors que

/etc/ssl# openssl x509 -text -noout -in cert.pem 
Certificate:
    Data:
        Version: 3 (0x2)
        Serial Number: 10089246514088260514 (0x8c04343fdb9433a2)
    Signature Algorithm: sha256WithRSAEncryption
        Issuer: C=FR, ST=Some-State, L=Toulouse, O=AROEVEN, OU=Midi-Pyrenees, CN=serveur AROEVEN/emailAddress=xx@xx.fr
        Validity
            Not Before: Jan 28 15:03:17 2015 GMT
            Not After : Jan 27 15:03:17 2018 GMT
        Subject: C=FR, ST=Some-State, L=Toulouse, O=AROEVEN, OU=Midi-Pyrenees, CN=serveur AROEVEN/emailAddress=xx@xx.fr
        Subject Public Key Info:
            Public Key Algorithm: rsaEncryption
                Public-Key: (2048 bit)
                Modulus:
                    00:d6:3d:81:e4:1b:ef:4a:28:fa:fc:ef:b2:b8:3c:
                   ...
                Exponent: 65537 (0x10001)
        X509v3 extensions:
            X509v3 Subject Key Identifier: 
                1A:71:FE:72:51:FE:17:9F:E4:1F:C0:01:D5:20:2E:51:70:03:9A:22
            X509v3 Authority Key Identifier: 
                keyid:1A:71:FE:72:51:FE:17:9F:E4:1F:C0:01:D5:20:2E:51:70:03:9A:22

            X509v3 Basic Constraints: 
                CA:TRUE
    Signature Algorithm: sha256WithRSAEncryption
         d2:86:df:ff:fe:63:c8:4e:e3:03:2d:b6:c4:98:72:59:0f:54:
         ...

Hors ligne

#20 Le 28/01/2015, à 23:24

Compte anonymisé

Re : Apache2 et SSL

c'est toi qui a caché des lignes ?   Modulus:
                    00:d6:3d:81:e4:1b:ef:4a:28:fa:fc:ef:b2:b8:3c:
                   ...

vérification de l'état d'une connexion ssl en ligne de commande:

openssl s_client -connect localhost:443

et

openssl s_client -connect 192.168.1.12:443

#21 Le 29/01/2015, à 10:33

tuxrouge

Re : Apache2 et SSL

oui c'est moi qui ai raccourci la sortie, je ne pensais pas que ce soit pertinent.

$ openssl s_client -connect localhost:443
CONNECTED(00000003)
140406163789472:error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol:s23_clnt.c:795:
---
no peer certificate available
---
No client certificate CA names sent
---
SSL handshake has read 7 bytes and written 305 bytes
---
New, (NONE), Cipher is (NONE)
Secure Renegotiation IS NOT supported
Compression: NONE
Expansion: NONE
---
$ openssl s_client -connect 192.168.1.12:443
CONNECTED(00000003)
139925298493088:error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol:s23_clnt.c:795:
---
no peer certificate available
---
No client certificate CA names sent
---
SSL handshake has read 7 bytes and written 305 bytes
---
New, (NONE), Cipher is (NONE)
Secure Renegotiation IS NOT supported
Compression: NONE
Expansion: NONE
---

et oui, 192.168.1.12 est l'adresse de la machine sur le réseau interne

Hors ligne

#22 Le 29/01/2015, à 12:59

Compte anonymisé

Re : Apache2 et SSL

salut, ça sent le problème de virtualhost à plein nez, erreur de connexion parcequ'il ne trouve pas de certificat (ni la clé)

peux tu donner le retour de ces 3 commandes:

vérifier si le module ssl  est bien chargé:
apachectl -t -D DUMP_MODULES | grep ssl

lister les virtualhost actifs, (dont default-ssl.conf)
apache2ctl -S

cat   /etc/apache2/sites-available/default-ssl.conf

Dernière modification par sirius007 (Le 29/01/2015, à 13:02)

#23 Le 29/01/2015, à 13:22

tuxrouge

Re : Apache2 et SSL

Voilà les sorties

root@serveur:~# apachectl -t -D DUMP_MODULES | grep ssl
AH00557: apache2: apr_sockaddr_info_get() failed for serveur
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1. Set the 'ServerName' directive globally to suppress this message
 ssl_module (shared)

root@serveur:~# apache2ctl -S
AH00557: apache2: apr_sockaddr_info_get() failed for serveur
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1. Set the 'ServerName' directive globally to suppress this message
VirtualHost configuration:
*:80                   127.0.0.1 (/etc/apache2/sites-enabled/000-default.conf:1)
*:3443                 127.0.0.1 (/etc/apache2/sites-enabled/owncloud-ssl.conf:3)
ServerRoot: "/etc/apache2"
Main DocumentRoot: "/var/www/html"
Main ErrorLog: "/var/log/apache2/error.log"
Mutex ssl-stapling: using_defaults
Mutex ssl-cache: using_defaults
Mutex default: dir="/var/lock/apache2" mechanism=fcntl 
Mutex mpm-accept: using_defaults
Mutex watchdog-callback: using_defaults
Mutex rewrite-map: using_defaults
PidFile: "/var/run/apache2/apache2.pid"
Define: DUMP_VHOSTS
Define: DUMP_RUN_CFG
User: name="www-data" id=33
Group: name="www-data" id=33

root@serveur:~# cat   /etc/apache2/sites-available/default-ssl.conf
<VirtualHost *:80>
	# The ServerName directive sets the request scheme, hostname and port that
	# the server uses to identify itself. This is used when creating
	# redirection URLs. In the context of virtual hosts, the ServerName
	# specifies what hostname must appear in the request's Host: header to
	# match this virtual host. For the default virtual host (this file) this
	# value is not decisive as it is used as a last resort host regardless.
	# However, you must set it for any further virtual host explicitly.
	#ServerName www.example.com

	ServerAdmin webmaster@localhost
	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
</VirtualHost>

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet

Hors ligne

#24 Le 29/01/2015, à 13:24

tuxrouge

Re : Apache2 et SSL

et voici mon /etc/hosts

# cat   /etc/hosts
127.0.0.1	localhost.localdomain localhost
127.0.1.1	serveur.aroeven	localhost

# The following lines are desirable for IPv6 capable hosts
::1     localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

Dernière modification par tuxrouge (Le 29/01/2015, à 13:24)

Hors ligne

#25 Le 29/01/2015, à 13:56

Compte anonymisé

Re : Apache2 et SSL

le problème est localisé. 
1  default-ssl.conf     n'est pas actif
2 son contenu n'est pas bon


mettre dans default-ssl.conf

NameVirtualHost *:443


<VirtualHost _default_:443>
#ServerName hostname du serveur
DocumentRoot /var/www/

<Directory />


 #Options -FollowSymLinks
                #Options Indexes FollowSymLinks MultiViews
                Options -ExecCGI
                Options -Indexes
                AllowOverride All
                Order allow,deny
                allow from all


</Directory>

#Les directives pour les certificats

SSLEngine On

SSLCertificateFile /etc/ssl/cert.pem
SSLCertificateKeyFile /etc/ssl/key.pem

bien vérifier les chemins:


SSLCertificateFile /etc/ssl/cert.pem
SSLCertificateKeyFile /etc/ssl/key.pem


a2ensite default-ssl.conf
/etc/init.d/apache2 restart

refaire le test:
openssl s_client -connect localhost:443

Dernière modification par sirius007 (Le 29/01/2015, à 14:03)