Page 1 sur 1
Problème Apache HTTP(s) vers HTTPS:PORT(autre que 443)
Publié : mar. 9 oct. 2012 01:07
par kalistyan
Je cherche le moyen d'utiliser deux certificats (différentes CA) dans un seul fichier PEM. Si utilisé séparément, tout fonctionne correctement. L'installation est validée via GeoCerts™ SSL Checker
ici
Par contre, une fois fusionné dans un seul fichier, seul le premier certificat est reconnu.
Syntaxe du fichier PEM
Code : Tout sélectionner
-----BEGIN RSA PRIVATE KEY-----
(Your Private Key: your_domain_name.key)
-----END RSA PRIVATE KEY-----
-----BEGIN CERTIFICATE-----
(Your Primary SSL certificate: your_domain_name.crt)
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE-----
(Your Intermediate certificate: DigiCertCA.crt)
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE-----
(Your Root certificate: TrustedRoot.crt)
-----END CERTIFICATE-----
Une p'tite idée ?

Problème Apache HTTP(s) vers HTTPS:PORT(autre que 443)
Publié : jeu. 11 oct. 2012 19:47
par asriel
hmm bizarre ton histoire. à priori j'aurais fait pareil

(deja fait sur une machine de prod en concatenant les certifs pour un nginx et ca roule...)
Problème Apache HTTP(s) vers HTTPS:PORT(autre que 443)
Publié : jeu. 17 janv. 2013 04:17
par kalistyan
Réponse du support technique, les certificats sont à configurer par port.
Testé avec deux clients.
mail.client1.fr:443
mail.client2.fr:446
Cela fonctionne.
Maintenant je souhaiterais rediriger automatiquement http vers https en fonction du client.
http://mail.client1.fr:80 =>
https://mail.client1.fr:443
Etc...
La redirection se fait, mais pas en https!
Que faut il rajouter dans le fichier de conf, à part SSLProxyEngine On ?
Merci.

Problème Apache HTTP(s) vers HTTPS:PORT(autre que 443)
Publié : jeu. 17 janv. 2013 19:55
par asriel
ha, le "SSLProxyEngine On" ne fait qu'activer le ssl

pour redirection, il faut rajouter une regle (soit dans un .htaccess à racine, ou directement dans la conf de ton virtualhost)
1/ avoir activé le module mod_rewrite
2/ ajouter
Code : Tout sélectionner
RewriteEngine on
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^/(.*) https://%{SERVER_NAME}/$1 [L,R]
ou
Code : Tout sélectionner
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
les 2 devraient marcher

Problème Apache HTTP(s) vers HTTPS:PORT(autre que 443)
Publié : jeu. 17 janv. 2013 20:59
par kalistyan
J'avance... Cela fonctionne avec le port 443 (client 1). Par contre, avec un autre port (446 dans mon test) J'ai une erreur de certificat...
Une idée ?

Problème Apache HTTP(s) vers HTTPS:PORT(autre que 443)
Publié : sam. 19 janv. 2013 14:26
par kalistyan
Impossible de trouver la syntaxe pour réécrire sur le port 446! Je souhaite rediriger les requêtes HTTP vers HTTPS:446
Code : Tout sélectionner
RewriteEngine On
RewriteCond %{HTTPS} !=off
RewriteRule ^(.*)$ https://mail.unnati.fr:446 [R=301]
Problème Apache HTTP(s) vers HTTPS:PORT(autre que 443)
Publié : sam. 19 janv. 2013 17:03
par kalistyan
Avec ceci
Code : Tout sélectionner
RewriteEngine on
Rewritecond %{HTTP_HOST} ^mail.unnati.fr$
Rewriterule ^(.*) https://mail.unnati.fr:446/$1 [QSA,L,R=301]
Cela donne =>
https://mail.unnati.fr:446/error_404.hsp?redirected=
Problème Apache HTTP(s) vers HTTPS:PORT(autre que 443)
Publié : sam. 19 janv. 2013 18:14
par asriel
bizarre, l'adresse
https://mail.unnati.fr:446/ fonctionne bien....
et si tu fais ta condition sur le port, du style
Code : Tout sélectionner
RewriteEngine on
RewriteCond %{SERVER_PORT} !^446$
RewriteRule ^/(.*) https://mail.unnati.fr:446/$1 [L,R]
Problème Apache HTTP(s) vers HTTPS:PORT(autre que 443)
Publié : sam. 19 janv. 2013 21:52
par kalistyan
Bien joué.
Un grand merci.
Edit : reste maintenant à rajouter une condition pour
HTTPS://mail.unnati.fr =>
HTTPS://mail.unnati.fr:446