mirror of
https://github.com/GaloisInc/cryptol.git
synced 2025-01-01 04:14:24 +03:00
dfae4580e3
Add support for TLS connections in both the rpc server and client. Allow the client to disable certificate validation via the `verify` keyword argument, i.e., `cryptol.connect(verify=False)`. The docker container for `cryptol-remote-api` also contains a self-signed cert for testing purposes. Co-authored-by: Andrew Kent <andrew@galois.com>
20 lines
562 B
Python
20 lines
562 B
Python
import sys
|
|
import argo_client.connection as argo
|
|
import cryptol
|
|
|
|
connType = sys.argv[1]
|
|
host = sys.argv[2]
|
|
port = int(sys.argv[3])
|
|
|
|
if connType == 'socket':
|
|
c = cryptol.connect(argo.RemoteSocketProcess(host, port=port, ipv6=False))
|
|
elif connType == 'http':
|
|
c = cryptol.connect(url="http://%s:%d/" % (host,port))
|
|
elif connType == 'https':
|
|
c = cryptol.connect(url="https://%s:%d/" % (host,port))
|
|
else:
|
|
raise Exception('specify socket, http, or https for connection type')
|
|
|
|
c.load_module('Cryptol')
|
|
assert c.evaluate_expression("1+1").result() == 2
|