improved tls selfsigned

master 1.0.1
LowEel 2021-07-31 18:07:38 +02:00
parent 90b8ece611
commit 885df1c4ab
2 changed files with 8 additions and 17 deletions

2
run.sh
View File

@ -12,7 +12,7 @@ export RECIPIENTS="./recipients.conf.example"
export MAILFOLDER="mail"
##MAIN
export USETLS="false"
export USETLS="true"
##RUN

23
tls.go
View File

@ -4,33 +4,19 @@ package main
import (
"crypto/ecdsa"
"crypto/ed25519"
"crypto/elliptic"
"crypto/rand"
"crypto/rsa"
"crypto/x509"
"crypto/x509/pkix"
"encoding/pem"
"log"
"math/big"
"net"
"os"
"strings"
"time"
)
@ -72,7 +58,7 @@ func ZMakecert() {
validFor := time.Duration(3650 * 24 * time.Hour)
isCA := false
isCA := true
rsaBits := 4096
@ -186,7 +172,12 @@ func ZMakecert() {
Subject: pkix.Name{
Organization: []string{"ZangTumb SMTP Server Department"},
Organization: []string{"ZangTumb Internal CA"},
Country: []string{"00"},
Province: []string{"5a622d3c-f218-11eb-9a03-0242ac130003"},
Locality: []string{"8927f2fa-f218-11eb-9a03-0242ac130003"},
StreetAddress: []string{"8927f3ea-f218-11eb-9a03-0242ac130003"},
PostalCode: []string{"666"},
},