Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SSL support #21

Open
azoksky opened this issue Feb 2, 2024 · 1 comment
Open

SSL support #21

azoksky opened this issue Feb 2, 2024 · 1 comment

Comments

@azoksky
Copy link

azoksky commented Feb 2, 2024

Modern security standards do not support old/weak short ssl key/cert setups. I also encountered other issues which I had to fix. Also there must be a way to make it work with self-signed cert. Can you make the changes in your code?

I really like this project. The code is robust. You have done a wonderful job. I am using this in stead of ssh as some virtual environment I work with block ssh connections.

For this to work i had to make these changes

Slaver :
def _make_ssl_context(self):
if ssl is None:
log.warning('ssl module is NOT valid in this machine! Fallback to plain')
return None

    ctx = ssl.create_default_context(ssl.Purpose.SERVER_AUTH)
    ctx.check_hostname = False
    ctx.verify_mode = ssl.CERT_NONE

    return ctx

Master:
def _make_ssl_context(self):
if ssl is None:
log.warning('ssl module is NOT valid in this machine! Fallback to plain')
return None
ctx = ssl.create_default_context(ssl.Purpose.CLIENT_AUTH)
ctx.check_hostname = False
ctx.verify_mode = ssl.CERT_NONE

    ctx.set_ciphers('DEFAULT@SECLEVEL=1')

    _certfile = tempfile.mktemp()
    with open(_certfile, 'w') as fw:
        fw.write(_DEFAULT_SSL_CERT)
    _keyfile = tempfile.mktemp()
    with open(_keyfile, 'w') as fw:
        fw.write(_DEFAULT_SSL_KEY)
    ctx.load_cert_chain(_certfile, _keyfile)
    os.remove(_certfile)
    os.remove(_keyfile)

    return ctx

Without these modifications, I could not get this to work.

I would request you to modify the code in line with modern standards. Also is it possible to make it work with self-signed cert?

@yumumu1988
Copy link

yumumu1988 commented Feb 2, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants