avro-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject [avro] 01/02: Support HTTPS in IPC HTTPTranceiver
Date Fri, 01 Mar 2019 20:46:30 GMT
This is an automated email from the ASF dual-hosted git repository.

dkulp pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/avro.git

commit 5714c9e837428279329b9758e415ce89118be646
Author: rbixler-eb <43047336+rbixler-eb@users.noreply.github.com>
AuthorDate: Tue Feb 26 13:33:53 2019 -0600

    Support HTTPS in IPC HTTPTranceiver
---
 lang/py3/avro/ipc.py | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/lang/py3/avro/ipc.py b/lang/py3/avro/ipc.py
index 792f764..07fa2ee 100644
--- a/lang/py3/avro/ipc.py
+++ b/lang/py3/avro/ipc.py
@@ -602,7 +602,7 @@ class Transceiver(object, metaclass=abc.ABCMeta):
 class HTTPTransceiver(Transceiver):
   """HTTP-based transceiver implementation."""
 
-  def __init__(self, host, port, req_resource='/'):
+  def __init__(self, host, port, req_resource='/', ssl=False):
     """Initializes a new HTTP transceiver.
 
     Args:
@@ -611,7 +611,10 @@ class HTTPTransceiver(Transceiver):
       req_resource: Optional HTTP resource path to use, '/' by default.
     """
     self._req_resource = req_resource
-    self._conn = http.client.HTTPConnection(host, port)
+    if (ssl):
+        self._conn = http.client.HTTPSConnection(host, port)
+    else:
+        self._conn = http.client.HTTPConnection(host, port)
     self._conn.connect()
     self._remote_name = self._conn.sock.getsockname()
 


Mime
View raw message