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

when use client.request to send a request to https url it falied with SSL3_GET_SERVER_CERTIFICATE #60

Closed
LouisZou opened this issue Jan 27, 2016 · 6 comments
Milestone

Comments

@LouisZou
Copy link

the error message like the following:
requests.exceptions.SSLError: [Errno bad handshake] [('SSL routines', 'SSL3_GET_SERVER_CERTIFICATE', 'certificate verify failed')]

when I new the client and send the request , can I add a parameters like "verify=False"?
I can use this parameters in requests.get()

@LouisZou
Copy link
Author

in the source code :
pyswagger/contrib/client/requests.py :46
if I add a parameters "verify=False", it work well.

so how can I transfer this parameter into the client.request(op(body={}))

@mission-liao
Copy link
Member

Hi, good work & finding. Those client implementation are made for common cases. One possible remedy for your case is to add an additional parameter when constructing the client object:

from pyswagger.contrib.client.requests import Client
client = Client(auth, verfiy=False) # the new way

All requests sent through this client would skip verification of ssl certificate, what do you think?

@LouisZou
Copy link
Author

Thanks mission-liao.
That's a good idea to add the SSL cert flag to Client object. so we can provide the different requests that whether use the verification when call the operation of restful API.

@mission-liao
Copy link
Member

OK, I would provide a fix on it next Monday, should be an easy fix.

@mission-liao
Copy link
Member

The fix would be included in next release, but right now, I'm still waiting for another PR for 'extensible content-type'.

@mission-liao mission-liao added this to the v0.8.18 milestone Feb 1, 2016
mission-liao added a commit that referenced this issue Feb 16, 2016
- #60
- it’s helpful to test server before production.
@mission-liao
Copy link
Member

This options required by requests.Session.send could be passed when constructing pyswagger.contrib.client.requests.Client

from pyswagger.contrib.client.requests import Client

client = Client(send_opt=dict(verify=False))

mission-liao added a commit that referenced this issue Feb 16, 2016
- customised codec: #49
- support for no SSL certificate
#60
- renders failed on windows
#63
mission-liao added a commit to pyopenapi/pyopenapi that referenced this issue Aug 12, 2017
- customised codec: pyopenapi/pyswagger#49
- support for no SSL certificate
pyopenapi/pyswagger#60
- renders failed on windows
pyopenapi/pyswagger#63
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

2 participants