[This is in relation to doing https://github.com/algorandfoundation/buildweb3 in Java]
This is odd:
Looking at the PureStake sample code, and with a PureStake account set up, and after trying some things in their Swagger Playground, I tried simply plugging in appropriate PureStake values on a copy of the GettingStarted class from the Java “Your First Transaction” demo:
private AlgodClient connectToNetwork() {
final String ALGOD_API_ADDR = "https://testnet-algorand.api.purestake.io/ps2";
final String ALGOD_API_TOKEN = <REDACTED>;
final String ALGOD_API_TOKEN_KEY = "X-API-Key";
final Integer ALGOD_PORT = 443;
. . .
It sat there for quite a few seconds, and then I got this:
Exception in thread "main" javax.net.ssl.SSLException: Received fatal alert: protocol_version
at sun.security.ssl.Alerts.getSSLException(Alerts.java:208)
at sun.security.ssl.Alerts.getSSLException(Alerts.java:154)
at sun.security.ssl.SSLSocketImpl.recvAlert(SSLSocketImpl.java:1977)
at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1093)
at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1328)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1355)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1339)
at com.squareup.okhttp.internal.io.RealConnection.connectTls(RealConnection.java:192)
at com.squareup.okhttp.internal.io.RealConnection.connectSocket(RealConnection.java:149)
at com.squareup.okhttp.internal.io.RealConnection.connect(RealConnection.java:112)
at com.squareup.okhttp.internal.http.StreamAllocation.findConnection(StreamAllocation.java:184)
at com.squareup.okhttp.internal.http.StreamAllocation.findHealthyConnection(StreamAllocation.java:126)
at com.squareup.okhttp.internal.http.StreamAllocation.newStream(StreamAllocation.java:95)
at com.squareup.okhttp.internal.http.HttpEngine.connect(HttpEngine.java:281)
at com.squareup.okhttp.internal.http.HttpEngine.sendRequest(HttpEngine.java:224)
at com.squareup.okhttp.Call.getResponse(Call.java:286)
at com.squareup.okhttp.Call$ApplicationInterceptorChain.proceed(Call.java:243)
at com.squareup.okhttp.Call.getResponseWithInterceptorChain(Call.java:205)
at com.squareup.okhttp.Call.execute(Call.java:80)
at com.algorand.algosdk.v2.client.common.Client.executeCall(Client.java:113)
at com.algorand.algosdk.v2.client.common.Query.baseExecute(Query.java:27)
at com.algorand.algosdk.v2.client.common.Query.baseExecute(Query.java:21)
at com.algorand.algosdk.v2.client.algod.AccountInformation.execute(AccountInformation.java:36)
at com.algorand.javatest.firsttransaction.GettingStartedPS.printBalance(GettingStartedPS.java:126)
at com.algorand.javatest.firsttransaction.GettingStartedPS.firstTransaction(GettingStartedPS.java:140)
at com.algorand.javatest.firsttransaction.GettingStartedPS.main(GettingStartedPS.java:211)
Clearly, something is not on speaking terms . . . .