Added flag for insecureSkipVerfiy (#1829)

This commit is contained in:
Rahul Bhati
2020-10-13 21:03:19 +05:30
committed by GitHub
parent d975534bf7
commit ab0b43d51c
3 changed files with 10 additions and 2 deletions
+3 -1
View File
@@ -677,7 +677,9 @@ spec:
- name: TLS_ENABLED
value: "true"
- name: MESSAGE_QUEUE_SECRETS
value: /etc/fission/secrets
value: /etc/fission/secrets
- name: INSECURE_SKIP_VERIFY
value: "{{ .Values.kafka.authentication.tls.insecureSkipVerify }}"
volumeMounts:
- name: kafka-secrets
mountPath: /etc/fission/secrets
+2
View File
@@ -184,6 +184,8 @@ kafka:
authentication:
tls:
enabled: false
# InsecureSkipVerify controls whether a client verifies the server's certificate chain and host name.
insecureSkipVerify: false # Warning: Setting this to true, makes TLS susceptible to man-in-the-middle attacks
caCert: "" # path to certificate containing public key of CA authority
userCert: "" # path to certificate containing public key of the user signed by CA authority
userKey: "" # path to private key of the user
+5 -1
View File
@@ -201,8 +201,12 @@ func (kafka Kafka) getTLSConfig() (*tls.Config, error) {
tlsConfig.Certificates = []tls.Certificate{cert}
skipVerify, err := strconv.ParseBool(os.Getenv("INSECURE_SKIP_VERIFY"))
if err != nil {
return nil, err
kafka.logger.Error("failed to parse value of env variable INSECURE_SKIP_VERIFY taking default value false, expected boolean value: true/false",
zap.String("received", os.Getenv("INSECURE_SKIP_VERIFY")))
} else {
tlsConfig.InsecureSkipVerify = skipVerify
}
caCertPool := x509.NewCertPool()