nativeauthenticator icon indicating copy to clipboard operation
nativeauthenticator copied to clipboard

SSL: WRONG_VERSION_NUMBER

Open rac021 opened this issue 1 year ago • 2 comments

Hi,

I'm trying to enable allow_self_approval, but I'm facing this error :

20:36:49.279 [ConfigProxy] debug: PROXY WEB /hub/signup to http://jupyterhub:8081
[E 2024-02-22 20:36:49.526 JupyterHub nativeauthenticator:357] [SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1007)

In the following, my configuration :

c.NativeAuthenticator.allow_self_approval_for = '[^@]+@hotmail\.com$'
    c.NativeAuthenticator.secret_key = "your-arbitrary-key-your-arbitrary-key-your-arbitrary-key-your"
    c.NativeAuthenticator.self_approval_email = (
        "[email protected]",
        "approval_link",
        "email body including https://hotmail.com{approval_url}",
    )
    c.NativeAuthenticator.self_approval_server = {
        'url': 'smtp.comp.fr',
        'usr': 'user.one',
        'pwd': '123456789'
    }

rac021 avatar Feb 22 '24 20:02 rac021

How can we use STARTTLS instead of SSL ?

rac021 avatar Feb 22 '24 23:02 rac021

To fix the issue, I have modified the code :

s = smtplib.SMTP_SSL(self.self_approval_server["url"])
s.login( self.self_approval_server["usr"], self.self_approval_server["pwd"]  )

To :

smtplib.SMTP(self.self_approval_server["url", 587 ]
s.ehlo()
s.starttls()  
s.ehlo()
s.login( self.self_approval_server["usr"], self.self_approval_server["pwd"] )

Maybe this should be integrated into the configuration ?

rac021 avatar Feb 23 '24 01:02 rac021