Skip to content

Commit ce50e30

Browse files
Validate arangosync client TLS keyfile before using (#1111)
1 parent 174c21d commit ce50e30

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

pkg/replication/sync_client.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,9 @@ func (dr *DeploymentReplication) createSyncMasterClient(epSpec api.EndpointSpec)
7777
if err != nil {
7878
return nil, errors.WithStack(err)
7979
}
80+
if err = kf.Validate(); err != nil {
81+
return nil, errors.WithStack(err)
82+
}
8083
tlsAuth.TLSClientAuthentication = tasks.TLSClientAuthentication{
8184
ClientCertificate: kf.EncodeCertificates(),
8285
ClientKey: kf.EncodePrivateKey(),
@@ -136,6 +139,9 @@ func (dr *DeploymentReplication) createArangoSyncTLSAuthentication(spec api.Depl
136139
if err != nil {
137140
return client.TLSAuthentication{}, errors.WithStack(err)
138141
}
142+
if err = kf.Validate(); err != nil {
143+
return client.TLSAuthentication{}, errors.WithStack(err)
144+
}
139145

140146
// Fetch TLS CA certificate for source
141147
caCert, err := k8sutil.GetCACertficateSecret(context.TODO(), secrets, tlsCASecretName)

0 commit comments

Comments
 (0)