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

Ability to turn off SSL verification when using requests #10

Open
byu1999 opened this issue Jan 12, 2024 · 7 comments
Open

Ability to turn off SSL verification when using requests #10

byu1999 opened this issue Jan 12, 2024 · 7 comments

Comments

@byu1999
Copy link

byu1999 commented Jan 12, 2024

I am having trouble creating a connection due to an SSL certificate verification error that arises when I use the requests library. I usually fix this error by setting verify=False for the session. However, I do not have the ability to do so this at the moment. Is there a way to add an extra parameter in the ffiec_connection module, so I can disable SSL certificate verification?

@mikehikes
Copy link
Contributor

Thank you for your question @byu1999 - could you let me know what platform (Windows, Linux, MacOS, etc) and python version you are using? With that information, I can better test a patch to provide that option.

@byu1999
Copy link
Author

byu1999 commented Jan 14, 2024

I am currently on Windows with python version 3.10. Thank you!

@mikehikes
Copy link
Contributor

I am currently on Windows with python version 3.10. Thank you!

Thank you! I'm working on a new version with the ability to disable SSL verification. Should be ready in a day or so.

@mikehikes
Copy link
Contributor

I may have a quick fix, @byu1999 , when you define the connection, use the following setting:

conn.session.verify_ssl = False

...and that should hypothetically work. Let me know if it does!

Full example:

creds = WebserviceCredentials(username="USER_NAME", password="PASSWORD")
conn = ffiec_connection.FFIECConnection()
conn.session.verify_ssl = False

from ffiec_data_connect import methods

time_series = methods.collect_data(
    session=conn,
    creds=creds,
    rssd_id="37",
    reporting_period="6/30/2022",
    series="call"
)

@byu1999
Copy link
Author

byu1999 commented Jan 17, 2024

Hi Mike, I have tried the quick fix method already, and it is still not working on my end. Thank you for all your help!

@mikehikes
Copy link
Contributor

Hi Mike, I have tried the quick fix method already, and it is still not working on my end. Thank you for all your help!

@byu1999, could you send me the tracebook (error log) with the ssl verify error?

@byu1999
Copy link
Author

byu1999 commented Jan 17, 2024

This is the error I get:
requests.exceptions.SSLError: HTTPSConnectionPool(host='cdr.ffiec.gov', port=443): Max retries exceeded with url: /Public/PWS/WebServices/RetrievalService.asmx?WSDL (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:997)')))

The reason for it is my company's security settings. I get this error when I make http requests. How I have been able to deal with them in the meantime is turn off SSL Certificate Verification with the verify parameter in Python's request library. If there is an easy way to do this with your library, that would be the easiest solution for me. Thanks again!

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