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

Where is SSLConfig? #904

Closed
qwerty32123 opened this issue Apr 12, 2020 · 3 comments
Closed

Where is SSLConfig? #904

qwerty32123 opened this issue Apr 12, 2020 · 3 comments
Labels
question Further information is requested

Comments

@qwerty32123
Copy link

qwerty32123 commented Apr 12, 2020

I ve been around 4 months witouth using HTTPX i installed again recently but my old code isnt working


        ssl_config = httpx.SSLConfig()

        ssl_context = ssl_config.load_ssl_context()

        ssl_context.options |= getattr(ssl, "OP_NO_TLSv1_3", 0)

        ssl_context.load_verify_locations(path)

im getting

ssl_config = httpx.SSLConfig()
AttributeError: module 'httpx' has no attribute 'SSLConfig'

@dalf
Copy link

dalf commented Apr 12, 2020

Since #785 SSLConfig has been moved to httpx._config.SSLConfig (a private package).

import httpx
import httpx._config

ssl_config = httpx._config.SSLConfig()
ssl_context = ssl_config.load_ssl_context()
client = httpx.AsyncClient(verify = ssl_context)

@qwerty32123
Copy link
Author

qwerty32123 commented Apr 12, 2020

@dalf

C:\Users\localhost\AppData\Local\Programs\Python\Python37\python.exe C:/Users/localhost/PycharmProjects/HTTP_BOT/httpx/llamadas_http.py
Traceback (most recent call last):
  File "C:/Users/localhost/PycharmProjects/HTTP_BOT/httpx/llamadas_http.py", line 2, in <module>
    from httpx.Client import http_Client
  File "C:\Users\localhost\PycharmProjects\HTTP_BOT\httpx\Client.py", line 6, in <module>
    import httpx._config
ModuleNotFoundError: No module named 'httpx._config'


code:

import httpx._config
    ssl_config = httpx._config.SSLConfig()

        ssl_context = ssl_config.load_ssl_context()

Im using version httpx 0.12.1

@qwerty32123
Copy link
Author

solved

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

No branches or pull requests

3 participants