components/python/requests/patches/solaris-changes.patch
branchs11-update
changeset 4072 db0cec748ec0
parent 3778 35735ffdda43
equal deleted inserted replaced
4067:4be1f488dda8 4072:db0cec748ec0
     1 This patch file makes two changes:
     1 This patch file adjusts the where() routine in certs.py to return the
       
     2 location of the standard certs bundle on Solaris.
     2 
     3 
     3 1/ Corrects the definition of is_solaris in compat.py.
     4 This change is only suitable for Solaris, and will not be sent upstream.
     4 2/ Adjusts the where() routine in certs.py to return the location
       
     5    of the standard certs bundle on Solaris.
       
     6 
     5 
     7 These changes have been sent upstream.
     6 --- requests-2.6.0/requests/certs.py	Sun Aug  3 06:15:57 2014
     8 
     7 +++ requests-2.6.0/requests/certs.py	Mon Mar 16 11:54:13 2015
     9 --- requests-1.2.3/requests/compat.py.orig	2013-07-31 07:31:19.545770096 -0700
     8 @@ -13,13 +13,9 @@
    10 +++ requests-1.2.3/requests/compat.py	2013-07-31 07:31:53.534460102 -0700
     9  """
    11 @@ -71,7 +71,7 @@
    10  import os.path
    12  is_linux = ('linux' in str(sys.platform).lower())
       
    13  is_osx = ('darwin' in str(sys.platform).lower())
       
    14  is_hpux = ('hpux' in str(sys.platform).lower())   # Complete guess.
       
    15 -is_solaris = ('solar==' in str(sys.platform).lower())   # Complete guess.
       
    16 +is_solaris = ('sunos' in str(sys.platform).lower())
       
    17  
    11  
    18  try:
    12 -try:
    19      import simplejson as json
    13 -    from certifi import where
    20 --- requests-1.2.3/requests/certs.py.orig	2013-07-31 07:34:29.859095710 -0700
    14 -except ImportError:
    21 +++ requests-1.2.3/requests/certs.py	2014-04-17 08:51:04.868103751 -0700
    15 -    def where():
    22 @@ -13,12 +13,15 @@
    16 -        """Return the preferred certificate bundle."""
    23  """
    17 -        # vendored bundle inside Requests
    24  
    18 -        return os.path.join(os.path.dirname(__file__), 'cacert.pem')
    25  import os.path
    19 +def where():
    26 -
    20 +    """Return the preferred certificate bundle."""
    27 +from requests import compat
    21 +    return "/etc/certs/ca-certificates.crt"
    28  
       
    29  def where():
       
    30      """Return the preferred certificate bundle."""
       
    31      # vendored bundle inside Requests
       
    32 -    return os.path.join(os.path.dirname(__file__), 'cacert.pem')
       
    33 +    if compat.is_solaris:
       
    34 +        return "/etc/certs/ca-certificates.crt"
       
    35 +    else:
       
    36 +        return os.path.join(os.path.dirname(__file__), 'cacert.pem')
       
    37  
    22  
    38  if __name__ == '__main__':
    23  if __name__ == '__main__':
    39      print(where())
    24      print(where())