mirror of
https://github.com/axllent/mailpit.git
synced 2025-08-15 20:13:16 +02:00
Feature: Add ability to generate self-signed (snakeoil) certificates for UI, SMTP and POP3 (#539)
This commit is contained in:
@@ -20,6 +20,7 @@ import (
|
||||
"github.com/axllent/mailpit/internal/logger"
|
||||
"github.com/axllent/mailpit/internal/pop3"
|
||||
"github.com/axllent/mailpit/internal/prometheus"
|
||||
"github.com/axllent/mailpit/internal/snakeoil"
|
||||
"github.com/axllent/mailpit/internal/stats"
|
||||
"github.com/axllent/mailpit/internal/storage"
|
||||
"github.com/axllent/mailpit/internal/tools"
|
||||
@@ -101,6 +102,12 @@ func Listen() {
|
||||
WriteTimeout: 30 * time.Second,
|
||||
}
|
||||
|
||||
// add temporary self-signed certificates to get deleted afterwards
|
||||
for _, keyPair := range snakeoil.Certificates() {
|
||||
storage.AddTempFile(keyPair.Public)
|
||||
storage.AddTempFile(keyPair.Private)
|
||||
}
|
||||
|
||||
if config.UITLSCert != "" && config.UITLSKey != "" {
|
||||
logger.Log().Infof("[http] starting on %s (TLS)", config.HTTPListen)
|
||||
logger.Log().Infof("[http] accessible via https://%s%s", logger.CleanHTTPIP(config.HTTPListen), config.Webroot)
|
||||
|
Reference in New Issue
Block a user