Changeset 1039:928f23d94583 for src/mlx


Ignore:
Timestamp:
03/14/22 14:27:02 (3 years ago)
Author:
István Váradi <ivaradi@…>
Branch:
python3
Phase:
public
Message:

Fixed the HTTPS access to the JSON-RPC handler (re #357)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/mlx/rpc.py

    r1034 r1039  
    99import calendar
    1010import sys
     11import ssl
     12import certifi
    1113
    1214#---------------------------------------------------------------------------------------
     
    481483        self._getCredentialsFn = getCredentialsFn
    482484
    483         self._server = jsonrpclib.Server(MAVA_BASE_URL + "/jsonrpc.php")
     485        sslContext = ssl.SSLContext()
     486        sslContext.load_verify_locations(cafile = certifi.where())
     487        transport = jsonrpclib.jsonrpc.SafeTransport(jsonrpclib.config.DEFAULT,
     488                                                     sslContext)
     489
     490        self._server = jsonrpclib.Server(MAVA_BASE_URL + "/jsonrpc.php",
     491                                         transport = transport)
    484492
    485493        self._userName = None
Note: See TracChangeset for help on using the changeset viewer.