Hi, we are using the Supertokens Golang SDK and th...
# support-questions-legacy
m
Hi, we are using the Supertokens Golang SDK and the EmailPassword recipe. We want to configure sending emails using our own SMTP server. We followed the instructions from the documentation (https://supertokens.com/docs/emailpassword/email-delivery/smtp/configure-smtp) and added the necessary configuration values with the value for the field
Secure
set to
false
. However even though it's set to false, we get an error related to the certificate verification: "tls: failed to verify certificate: x509: certificate is valid for localhost, not ". After inspecting the code, we noticed that, in the gomail library which the Supertokens SDK is using, if
SSL
is set to
false
(which is true in this case when the
Secure
field is set to
false
),
STARTTLS
is used, which is most likely the reason why we get an error during the verification of certificates. In the Supertokens Golang SDK, the line for disabling certificate verification (https://github.com/supertokens/supertokens-golang/blob/master/ingredients/emaildelivery/main.go#L63) is used ony if the
Secure
field in the SMTP configuration struct is set to
true
. When trying out locally, we noticed that adding this line for disabling certificate verification in the case when
SSL
is set to
false
allowed us to use our own SMTP server without any errors. As far as we are aware, currently there is no way to disable certificate verification if the field
Secure
is set to
false
in the Supertokens Golang SDK SMTP settings, which is something that we would need in order to be able to use our own SMTP server. Is there anything we could do to be able to disable certificate verification in this case? Or would it be possible for you to somehow expose the setting in the SDK, to allow us to define whether we want to disable cerfiticate verification?
2 Views