{"action":"created","issue":{"url":"https://api.github.com/repos/tomav/docker-mailserver/issues/33","labels_url":"https://api.github.com/repos/tomav/docker-mailserver/issues/33/labels{/name}","comments_url":"https://api.github.com/repos/tomav/docker-mailserver/issues/33/comments","events_url":"https://api.github.com/repos/tomav/docker-mailserver/issues/33/events","html_url":"https://github.com/tomav/docker-mailserver/issues/33","id":115633640,"number":33,"title":"ssl certs","user":{"login":"kopax","id":1866564,"avatar_url":"https://avatars.githubusercontent.com/u/1866564?v=3","gravatar_id":"","url":"https://api.github.com/users/kopax","html_url":"https://github.com/kopax","followers_url":"https://api.github.com/users/kopax/followers","following_url":"https://api.github.com/users/kopax/following{/other_user}","gists_url":"https://api.github.com/users/kopax/gists{/gist_id}","starred_url":"https://api.github.com/users/kopax/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kopax/subscriptions","organizations_url":"https://api.github.com/users/kopax/orgs","repos_url":"https://api.github.com/users/kopax/repos","events_url":"https://api.github.com/users/kopax/events{/privacy}","received_events_url":"https://api.github.com/users/kopax/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/tomav/docker-mailserver/labels/enhancement","name":"enhancement","color":"84b6eb"},{"url":"https://api.github.com/repos/tomav/docker-mailserver/labels/question","name":"question","color":"cc317c"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2015-11-07T04:52:27Z","updated_at":"2015-11-17T10:05:59Z","closed_at":null,"body":"I am trying to install my own ssl certs.\r\n\r\nIn `start-mailserver.sh` you have `if [ -e \"/tmp/postfix/ssl/$(hostname)-cert.pem\" ]`, the file doesn't exist but another file is present and not used by the script : __mail.domain.com-req__\r\n\r\n - Should I rename the file ?\r\n\r\nI have tried by renaming it and it didn't worked : \r\n\r\n\tCONNECTED(00000003)\r\n\t140445282178704:error:140790E5:SSL routines:SSL23_WRITE:ssl handshake failure:s23_lib.c:184:\r\n\t---\r\n\tno peer certificate available\r\n\t---\r\n\tNo client certificate CA names sent\r\n\t---\r\n\tSSL handshake has read 0 bytes and written 295 bytes\r\n\t---\r\n\tNew, (NONE), Cipher is (NONE)\r\n\tSecure Renegotiation IS NOT supported\r\n\tCompression: NONE\r\n\tExpansion: NONE\r\n\t---\r\n\r\nLooking at the script : \r\n\r\n\t  # Postfix configuration\r\n\t  sed -i -r 's/smtpd_tls_cert_file=\\/etc\\/ssl\\/certs\\/ssl-cert-snakeoil.pem/smtpd_tls_cert_file=\\/etc\\/postfix\\/ssl\\/'$(hostname)'-cert.pem/g' /etc/postfix/main.cf\r\n\t  sed -i -r 's/smtpd_tls_key_file=\\/etc\\/ssl\\/private\\/ssl-cert-snakeoil.key/smtpd_tls_key_file=\\/etc\\/postfix\\/ssl\\/'$(hostname)'-key.pem/g' /etc/postfix/main.cf\r\n\t  sed -i -r 's/#smtpd_tls_CAfile=/smtpd_tls_CAfile=\\/etc\\/postfix\\/ssl\\/cacert.pem/g' /etc/postfix/main.cf\r\n\t  sed -i -r 's/#smtp_tls_CAfile=/smtp_tls_CAfile=\\/etc\\/postfix\\/ssl\\/cacert.pem/g' /etc/postfix/main.cf\r\n\t  ln -s /etc/postfix/ssl/cacert.pem /etc/ssl/certs/cacert-$(hostname).pem\r\n\r\n\t  # Courier configuration\r\n\t  sed -i -r 's/TLS_CERTFILE=\\/etc\\/courier\\/imapd.pem/TLS_CERTFILE=\\/etc\\/postfix\\/ssl\\/'$(hostname)'-combined.pem/g' /etc/courier/imapd-ssl\r\n\r\nBecause the provided sample is not working, I am trying to guess how it should work using this [explanation](http://wiki.queret.net/docs/ssl/certificats_gandi)\r\n\r\nThe servers only needs these 4 files :\r\n \r\n1. mail.domain.com-cert.pem\r\n1. mail.domain.com-key.pem\r\n1. cacert.pem\r\n1. mail.domain.com-combined.pem\r\n\r\nI have buy my certs on Gandi, I was able to prepare this : \r\n\r\n1. mail.domain.com-cert.pem > certificat -> provided by gandi and contain 1 key\r\n1. mail.domain.com-key.pem > generated key -> provided when generating the csr, contain 1 key\r\n1. cacert.pem > GandiStandardSSLCA2.pem > provided by gandi, contain 2 keys\r\n1. mail.domain.com-combiner.pem > concatened certificate > made by me, contain 4 keys __(mine x 1 + gandi x 2 + comodo x 1)__\r\n\r\nEverything seems ok to me, I have tried, still not working.\r\n\r\nDoes anyone did tried to add their own signed certs ?"},"comment":{"url":"https://api.github.com/repos/tomav/docker-mailserver/issues/comments/157325869","html_url":"https://github.com/tomav/docker-mailserver/issues/33#issuecomment-157325869","issue_url":"https://api.github.com/repos/tomav/docker-mailserver/issues/33","id":157325869,"user":{"login":"nathema","id":937788,"avatar_url":"https://avatars.githubusercontent.com/u/937788?v=3","gravatar_id":"","url":"https://api.github.com/users/nathema","html_url":"https://github.com/nathema","followers_url":"https://api.github.com/users/nathema/followers","following_url":"https://api.github.com/users/nathema/following{/other_user}","gists_url":"https://api.github.com/users/nathema/gists{/gist_id}","starred_url":"https://api.github.com/users/nathema/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nathema/subscriptions","organizations_url":"https://api.github.com/users/nathema/orgs","repos_url":"https://api.github.com/users/nathema/repos","events_url":"https://api.github.com/users/nathema/events{/privacy}","received_events_url":"https://api.github.com/users/nathema/received_events","type":"User","site_admin":false},"created_at":"2015-11-17T10:05:59Z","updated_at":"2015-11-17T10:05:59Z","body":"@tomav Renaming the files precisely according to `start-mailserver.sh` fixed it. Checked with openssl. Thanx! \r\n\r\nAfter getting more familiar with docker, I might contribute to this project!"}}