Skip to content

Commit

Permalink
Support older urllib3 versions, ssl_minimum_version is not available …
Browse files Browse the repository at this point in the history
…before urllib 2.0.0
  • Loading branch information
hannob committed Nov 28, 2023
1 parent bf5eed6 commit cd14402
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions snallygaster
Original file line number Diff line number Diff line change
Expand Up @@ -981,8 +981,13 @@ args = parser.parse_args()
user_agent = {'user-agent': 'Mozilla/5.0 (X11; Linux x86_64; rv:53.0) Gecko/20100101 Firefox/53.0'}
if args.useragent:
user_agent = {'user-agent': args.useragent}
pool = urllib3.PoolManager(10, headers=user_agent, cert_reqs='CERT_NONE', # noqa: DUO132
retries=False, timeout=2, ssl_minimum_version=ssl.TLSVersion.SSLv3)
urllib3_major = int(urllib3.__version__.split(".")[0])
if urllib3_major >= 2:
pool = urllib3.PoolManager(10, headers=user_agent, cert_reqs='CERT_NONE', # noqa: DUO132
retries=False, timeout=2, ssl_minimum_version=ssl.TLSVersion.SSLv3)
else:
pool = urllib3.PoolManager(10, headers=user_agent, cert_reqs='CERT_NONE', # noqa: DUO132
retries=False, timeout=2)

# This is necessary for directory traversal attacks like citrix_cve
urllib3.util.url.NORMALIZABLE_SCHEMES = ()
Expand Down

0 comments on commit cd14402

Please sign in to comment.