title: https get request python (HTTPS / SSL)
body: <p>So i'm working on converting a java program I have over to python. In my java code I have a http get call that looks like this.</p>
  
  <pre><code>sslContext.init(null, new TrustManager[] { new X509TrustManager() {
              public X509Certificate[] getAcceptedIssuers() {
                  return null;
              }
  
              public void checkClientTrusted(X509Certificate[] certs, String authType) {
              }
  
              public void checkServerTrusted(X509Certificate[] certs, String authType) {
              }
          } }, new SecureRandom());
          try {
              CloseableHttpClient httpclient = HttpClients.custom()
                      .setSSLSocketFactory(new org.apache.http.conn.ssl.SSLSocketFactory(sslContext)).build();
  
              String authString = username + ":" + password;
              byte[] authEncBytes = Base64.encodeBase64(authString.getBytes());
              String authStringEnc = new String(authEncBytes);
  
              HttpGet httpGet = new HttpGet(envURL);
              httpGet.setHeader("Content-Type", "application/json");
  
              httpGet.setHeader("Authorization", "Basic " + authStringEnc);
  
              CloseableHttpResponse httpGetResponse = httpclient.execute(httpGet);
  
              HttpEntity entityResponse = httpGetResponse.getEntity();
              String result = EntityUtils.toString(entityResponse);
              EntityUtils.consume(entityResponse);
              JSONParser parser = new JSONParser();
              thresholdContent = (JSONArray) parser.parse(result);
  
          } catch (Exception e) {
              e.printStackTrace();
          }
  </code></pre>
  
  <p>i'm trying to find the cleanist way to do this in python 3.x. Or I guess the standered for doing something like this in python. </p>
  
  <p>I've tried soemthing like: </p>
  
  <pre><code>conn = requests.get(env, headers={"content-type":"application/json"}, auth=(userName,password))
  </code></pre>
  
  <p>but have not had much luck.</p>