Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
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

Copy link
Copy link
@dtoma

Description

@dtoma
Issue body actions

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.

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.