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

SSE SSL authentication not supported #247

Closed
alsterg opened this issue May 3, 2018 · 2 comments
Closed

SSE SSL authentication not supported #247

alsterg opened this issue May 3, 2018 · 2 comments

Comments

@alsterg
Copy link

alsterg commented May 3, 2018

client.py:_do_sse_request() does not respect the self.verify setting, and does not provide any way to authentication based on credentials (verify or cert).

The following code fails with: ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:777)

from marathon import MarathonClient
import logging

c = MarathonClient('https://localhost:8080', verify=False)
for event in c.event_stream(raw=True):
    print(event)

Assuming that Marathon runs on localhost:8080 with SSL and no user authentication.

@iksaif
Copy link
Contributor

iksaif commented May 4, 2018

Here is how to do it (use sse_session=):

import marathon
import requests
import os

session = requests.Session()
session.verify = False

c = marathon.MarathonClient(
    'https://marathon-pa4.central.criteo.preprod/',
    verify=False,
    sse_session=session,
    username=os.getenv('MARATHON_USERNAME'),
    password=os.getenv('MARATHON_PASSWORD'),
)

for event in c.event_stream(raw=True):
    print(event)

@alsterg
Copy link
Author

alsterg commented May 4, 2018

Thanks for the a workaround!

Still, I would expect the library to enforce verify=False, since MarathonClient() accepts it as an argument.

iksaif added a commit to iksaif/marathon-python that referenced this issue May 4, 2018
iksaif added a commit to iksaif/marathon-python that referenced this issue May 4, 2018
iksaif added a commit to iksaif/marathon-python that referenced this issue May 5, 2018
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

3 participants