Skip to content

Commit

Permalink
RPC: Added support for HTTPS access URLs
Browse files Browse the repository at this point in the history
When the server uses SSL, forge an https://... URL, to fix #69
  • Loading branch information
tcalmant committed Aug 27, 2016
1 parent d3d529c commit 5182dc7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion pelix/remote/json_rpc.py
Expand Up @@ -160,7 +160,8 @@ def get_access(self):
Retrieves the URL to access this component
"""
port = self._http.get_access()[1]
return "http://{{server}}:{0}{1}".format(port, self._path)
return "http{2}://{{server}}:{0}{1}".format(
port, self._path, "s" if self._http.is_https() else "")

def make_endpoint_properties(self, svc_ref, name, fw_uid):
"""
Expand Down
3 changes: 2 additions & 1 deletion pelix/remote/transport/jabsorb_rpc.py
Expand Up @@ -210,7 +210,8 @@ def get_accesses(self):

# Return two accesses: with a {server} variable and with the
# bound address
model = "http://{{server}}:{0}{1}".format(port, self._path)
model = "http{2}://{{server}}:{0}{1}".format(
port, self._path, "s" if self._http.is_https() else "")
return ','.join((model, model.format(server=host)))

@Validate
Expand Down
3 changes: 2 additions & 1 deletion pelix/remote/xml_rpc.py
Expand Up @@ -159,7 +159,8 @@ def get_access(self):
Retrieves the URL to access this component
"""
port = self._http.get_access()[1]
return "http://{{server}}:{0}{1}".format(port, self._path)
return "http{2}://{{server}}:{0}{1}".format(
port, self._path, "s" if self._http.is_https() else "")

def make_endpoint_properties(self, svc_ref, name, fw_uid):
"""
Expand Down

0 comments on commit 5182dc7

Please sign in to comment.