requests.exceptions.ConnectionError: HTTPSConnectionPool(host='1.1.1.1', port=5821): Max retries exceeded with url: /admin/databases (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x000001E497014AC0>: Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it'))
Is there any possibility that your Stardog instance is behind a reverse proxy? If it was and one of your servers has a misconfigured firewall that might explain the seemingly random errors connecting. The "the target machine actively refused it" means it made a connection and the machine explicitly said, "Nope!" which you see when a firewall actively closes connections. If it happens all the time it might just be a firewall config problem.
Now it looks like you’re having a problem negotiating a TLS cypher suite. I’ll take a look at the pystardog code and see if I can come up with some suggestions.
When a local query was tried (ssh into the VM) ... Got the error:
ubuntu@bbn-stardog:/var/opt/stardog$ stardog query https://1.1.1.1:5821 'select * WHERE {?s ?p ?o} LIMIT 10'
ERROR 2020-05-04 19:03:21,380 [main] com.complexible.stardog.security.PasswordFile:getCredentials(242): Server URL provided to password file was not valid
java.net.URISyntaxException: Expected authority at index 8: https://
at java.net.URI$Parser.fail(URI.java:2848) ~[?:1.8.0_252]
at java.net.URI$Parser.failExpecting(URI.java:2854) ~[?:1.8.0_252]
at java.net.URI$Parser.parseHierarchical(URI.java:3102) ~[?:1.8.0_252]
at java.net.URI$Parser.parse(URI.java:3053) ~[?:1.8.0_252]
at java.net.URI.(URI.java:588) ~[?:1.8.0_252]
at com.complexible.stardog.security.PasswordFile.getCredentials(PasswordFile.java:239) [stardog-core-shared-7.2.1.jar:?]
at com.complexible.stardog.cli.impl.BaseStardogCommand.computeCredentials(BaseStardogCommand.java:99) [stardog-cli-7.2.1.jar:?]
at com.complexible.stardog.cli.impl.BaseStardogCommand.getCredentials(BaseStardogCommand.java:86) [stardog-cli-7.2.1.jar:?]
at com.complexible.stardog.cli.impl.ConnectionCommand.connect(ConnectionCommand.java:127) [stardog-cli-7.2.1.jar:?]
at com.complexible.stardog.cli.impl.ConnectionCommand.call(ConnectionCommand.java:74) [stardog-cli-7.2.1.jar:?]
at com.complexible.stardog.cli.CLIBase.execute(CLIBase.java:56) [stardog-cli-7.2.1.jar:?]
at com.complexible.stardog.cli.CLI.main(CLI.java:111) [stardog-cli-7.2.1.jar:?]
Remote host closed connection during handshake
The username password was set in the home directory in .sdpass.
Are you setting the stardog.passwd.file system property and if you are is it pointing to your sdpass file? If not is the .sdpass file in the home directory of the user your running as?
And, here is more info ... openssl s_client -cipher ALL -connect localhost:5821
CONNECTED(00000005)
write:errno=0
no peer certificate available
No client certificate CA names sent
SSL handshake has read 0 bytes and written 405 bytes
Verification: OK
New, (NONE), Cipher is (NONE)
Secure Renegotiation IS NOT supported
Compression: NONE
Expansion: NONE
No ALPN negotiated
Early data was not sent
Verify return code: 0 (ok)
Also, I have to use a self-signed cert. When I connect to the server using Studio, I can connect using http:. But, when I use https:, and indicate in advanced options that I have a self-signed cert, the connection is still refused.