Skip to content
This repository was archived by the owner on Mar 18, 2019. It is now read-only.
This repository was archived by the owner on Mar 18, 2019. It is now read-only.

Merge environment settings for SSL requests #152

@dtoma

Description

@dtoma

Hello,
Using v2.3.3, I can't make requests to an SSL endpoint:

import coreapi

client = coreapi.Client()
schema = client.get('https://my-service.url/docs/:443')
requests.exceptions.SSLError: HTTPSConnectionPool(host='my-service.url', port=443): Max retries exceeded with url: /docs/ (Caused by SSLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:645)'),))

According to this issue in the requests repo, environment settings need to be explicitely added to the session.send call in coreapi/transports/http.py:

    def transition(self, link, decoders, params=None, link_ancestors=None, force_codec=False):
        # ...
        settings = session.merge_environment_settings(request.url, None, None, None, None)
        response = session.send(request, **settings)
        result = _decode_result(response, decoders, force_codec)
        # ...

This fixes the issue for me and I'm able to make requests to my service.

I have opened #153.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy