[PD1] minor change
This commit is contained in:
parent
b8efcf19b7
commit
0fa940f853
1 changed files with 4 additions and 4 deletions
|
|
@ -50,12 +50,12 @@ func LoadKeyStore(keyStorePath string, password string) KeyStore {
|
||||||
|
|
||||||
var privKey *rsa.PrivateKey
|
var privKey *rsa.PrivateKey
|
||||||
|
|
||||||
certFile, err := os.ReadFile(keyStorePath)
|
keystoreBytes, err := os.ReadFile(keyStorePath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Panicln("Provided certificate couldn't be opened")
|
log.Panicln("Provided keystorePath couldn't be opened")
|
||||||
}
|
}
|
||||||
|
|
||||||
privKeyInterface, cert, caCerts, err := pkcs12.DecodeChain(certFile, password)
|
privKeyInterface, cert, caCerts, err := pkcs12.DecodeChain(keystoreBytes, password)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Panicln("PKCS12 key store couldn't be decoded")
|
log.Panicln("PKCS12 key store couldn't be decoded")
|
||||||
}
|
}
|
||||||
|
|
@ -94,7 +94,7 @@ func (k *KeyStore) GetServerTLSConfig() *tls.Config {
|
||||||
caCertPool.AddCert(caCert)
|
caCertPool.AddCert(caCert)
|
||||||
}
|
}
|
||||||
tlsConfig.ClientCAs = caCertPool
|
tlsConfig.ClientCAs = caCertPool
|
||||||
//FIX: SERVER ACCEPTS CONNECTIONS WITH UNMATCHING OR
|
//FIX: SERVER ACCEPTS CONNECTIONS WITH UNMATCHING OR
|
||||||
// NO CERTIFICATE, NEEDS TO BE CHANGED SOMEHOW
|
// NO CERTIFICATE, NEEDS TO BE CHANGED SOMEHOW
|
||||||
tlsConfig.ClientAuth = tls.RequireAndVerifyClientCert
|
tlsConfig.ClientAuth = tls.RequireAndVerifyClientCert
|
||||||
return tlsConfig
|
return tlsConfig
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue