salut
j’essaie de me monter un petit serveur http avec prise en charge ssl
je fais ça avec thttpd et stunnel4
j’ai trouvé de la doc là : http://buffalo.nas-central.org/wiki/Articles/GeneralThttpd et là : http://buffalo.nas-central.org/index.php/Run_a_third_instance_of_thttpd_as_an_SSL_server,_via_stunnel
et donc je me suis lancé
et dans la mesure où je pose dans SD vous vous doutez bien que ça ne marche pas
gobalement j’ai configuré stunnel pour qu’il bosse sur le port 8080 et je lance une instance de thttpd également sur le port 8080.
Mes fichiers de conf sont les suivant :
/etc/default/stunnel
[code]# /etc/default/stunnel
Julien LEMOINE speedblue@debian.org
September 2003
Change to one to enable stunnel
ENABLED=1
FILES="/etc/stunnel/*.conf"
OPTIONS=""
Change to one to enable ppp restart scripts
PPP_RESTART=0
[/code]
/etc/stunnel/stunnel.conf
[code]; Sample stunnel configuration file by Michal Trojnara 2002-2006
; Some options used here may not be adequate for your particular configuration
; Please make sure you understand them (especially the effect of chroot jail)
; Certificate/key is needed in server mode and optional in client mode
cert = /etc/ssl/certs/stunnel.pem
key = /etc/ssl/certs/stunnel.pem
; Protocol version (all, SSLv2, SSLv3, TLSv1)
sslVersion = SSLv3
; Some security enhancements for UNIX systems - comment them out on Win32
chroot = /var/lib/stunnel4/
setuid = stunnel4
setgid = stunnel4
; PID is created inside chroot jail
pid = /stunnel4.pid
; Some performance tunings
socket = l:TCP_NODELAY=1
socket = r:TCP_NODELAY=1
;compression = rle
; Workaround for Eudora bug
;options = DONT_INSERT_EMPTY_FRAGMENTS
; Authentication stuff
;verify = 2
; Don’t forget to c_rehash CApath
; CApath is located inside chroot jail
;CApath = /certs
; It’s often easier to use CAfile
;CAfile = /etc/stunnel/certs.pem
; Don’t forget to c_rehash CRLpath
; CRLpath is located inside chroot jail
;CRLpath = /crls
; Alternatively you can use CRLfile
;CRLfile = /etc/stunnel/crls.pem
; Some debugging stuff useful for troubleshooting
debug = 7
output = /var/log/stunnel4/stunnel.log
; Use it for client mode
client = no
; Service-level configuration
;[pop3s]
;accept = 995
;connect = 110
;[imaps]
;accept = 993
;connect = 143
;[ssmtp]
;accept = 465
;connect = 25
[https]
accept = 443
connect = 8080
TIMEOUTclose = 0
; vim:ft=dosini
[/code]
Quand à thttpd je ne vous sors pas la conf (pour l’instant) mais sachez qu’un adresse_ip:8080 fonctionne.
Par contre https://adresse_ip:8080 ne fonctionne pas.
Le mieux que j’ai eu est ça (resultat de log stunnel) :
2009.08.13 12:21:56 LOG7[24625:1100421456]: https permitted by libwrap from 127.0.0.1:47819
2009.08.13 12:21:56 LOG5[24625:1100421456]: https accepted connection from 127.0.0.1:47819
2009.08.13 12:21:56 LOG7[24625:1100421456]: SSL state (accept): before/accept initialization
2009.08.13 12:21:56 LOG3[24625:1100421456]: SSL_accept: 1408F10B: error:1408F10B:SSL routines:SSL3_GET_RECORD:wrong version number
2009.08.13 12:21:56 LOG5[24625:1100421456]: Connection reset: 0 bytes sent to SSL, 0 bytes sent to socket
2009.08.13 12:21:56 LOG7[24625:1100421456]: https finished (-1 left)
Et si je passe avec une version inférieure je n’ai plus rien du tout.
C’est ma première implémentation ssl et stunnel et google ne m’apporte pas de réponse bien pertinente.
Edit : je suis sous lenny amd64 et le client est w3m en local