Skip to content

Where is SSLConfig? #904

Closed
Closed

Description

@qwerty32123

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'

Activity

  1. dalf commented on Apr 12, 2020

    @dalf

    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)
  2. qwerty32123 commented on Apr 12, 2020

    @qwerty32123
    Author

    @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

  3. qwerty32123 commented on Apr 12, 2020

    @qwerty32123
    Author

    solved

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions