
    >/id
                         S r SSKrSSKJr  SSKJr  \R                  " S5      \R                  " S5      S 5       5       rg)a  
=============================================
B501: Test for missing certificate validation
=============================================

Encryption in general is typically critical to the security of many
applications.  Using TLS can greatly increase security by guaranteeing the
identity of the party you are communicating with.  This is accomplished by one
or both parties presenting trusted certificates during the connection
initialization phase of TLS.

When HTTPS request methods are used, certificates are validated automatically
which is the desired behavior.  If certificate validation is explicitly turned
off Bandit will return a HIGH severity error.


:Example:

.. code-block:: none

    >> Issue: [request_with_no_cert_validation] Call to requests with
    verify=False disabling SSL certificate checks, security issue.
       Severity: High   Confidence: High
       CWE: CWE-295 (https://cwe.mitre.org/data/definitions/295.html)
       Location: examples/requests-ssl-verify-disabled.py:4
    3   requests.get('https://gmail.com', verify=True)
    4   requests.get('https://gmail.com', verify=False)
    5   requests.post('https://gmail.com', verify=True)

.. seealso::

 - https://security.openstack.org/guidelines/dg_move-data-securely.html
 - https://security.openstack.org/guidelines/dg_validate-certificates.html
 - https://cwe.mitre.org/data/definitions/295.html

.. versionadded:: 0.9.0

.. versionchanged:: 1.7.3
    CWE information added

.. versionchanged:: 1.7.5
    Added check for httpx module

    N)issue)test_propertiesCallB501c           	         1 Skn1 SkU-  nU R                   R                  S5      S   nUS:X  a  U R                  U;   d  US:X  a  U R                  U;   aw  U R                  SS5      (       a_  [        R
                  " [        R                  [        R                  [        R                  R                  S	U S
3U R                  S5      S9$ g g g )N>   getputheadpostpatchdeleteoptions>   ClientstreamrequestAsyncClient.r   requestshttpxverifyFalsezCall to zD with verify=False disabling SSL certificate checks, security issue.)severity
confidencecwetextlineno)call_function_name_qualsplitcall_function_namecheck_call_arg_valuebanditIssueHIGHr   CweIMPROPER_CERT_VALIDATIONget_lineno_for_call_arg)context
HTTP_VERBSHTTPX_ATTRSqualnames       j/home/james-whalen/.local/lib/python3.13/site-packages/bandit/plugins/crypto_request_no_cert_validation.pyrequest_with_no_cert_validationr,   6   s     NJ@:MK..44S9!<H 	J&&*4w&&+5'''::<<!;;II66z *6 666x@  ; 6     )	__doc__r!   bandit.corer   r   testcheckstest_idr,    r-   r+   <module>r4      sD   
+X   / Vf  r-   