This repository was archived by the owner on Apr 24, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from deep-security/deep-security-sdk-update
Deep Security SDK Update & Ignoring SSL Certification Validation
- Loading branch information
Showing
12 changed files
with
120 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import ssl | ||
import urllib2 | ||
from suds.transport.http import HttpTransport, Reply, TransportError | ||
|
||
class HTTPSIgnoreValidation(HttpTransport): | ||
""" | ||
An HTTPS Handler set to ignore SSL certificate validation | ||
The software and AWS Marketplace installations of Deep Security default to using | ||
a self-signed certificate and require this handler for SOAP API access | ||
With help from; | ||
@nitwit via http://stackoverflow.com/questions/6277027/suds-over-https-with-cert | ||
@enno groper via http://stackoverflow.com/questions/19268548/python-ignore-certicate-validation-urllib2 | ||
""" | ||
def __init__(self, *args, **kwargs): HttpTransport.__init__(self, *args, **kwargs) | ||
|
||
def u2open(self, u2request): | ||
""" | ||
Open a connection. | ||
@param u2request: A urllib2 request. | ||
@type u2request: urllib2.Requet. | ||
@return: The opened file-like urllib2 object. | ||
@rtype: fp | ||
""" | ||
tm = self.options.timeout | ||
ctx = ssl.create_default_context() | ||
ctx.check_hostname = False | ||
ctx.verify_mode = ssl.CERT_NONE | ||
return urllib2.urlopen(u2request, context=ctx) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters