Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connect to server with binary protocol using ssl #433

Open
fersm opened this issue May 7, 2020 · 0 comments
Open

Connect to server with binary protocol using ssl #433

fersm opened this issue May 7, 2020 · 0 comments

Comments

@fersm
Copy link

fersm commented May 7, 2020

Hi.

When performing connection tests using the binary protocol with and without ssl enabled using pooled sessions with OrientDBClient:

const client = await OrientDBClient.connect({
host: '12.0.0.1',
port: '2424' // or port: '2434' for ssl
});
const sessionsPool = await client.sessions({
name: 'demo',
username: 'test',
password: 'xxxxxxxxxxx'
});
await sessionsPool.acquire().then( async session => {
await session.select().from('Store').all().then( async stores => {
console.log( stores )
} )
} )

Using port 2434 for SSL, the application cannot connect to the server and is frozen waiting for the connection (const client = await OrientDBClient.connect) without showing any error or failure. When I close the application, on the server side, the following appears in the log:

Error on client connection
javax.net.ssl.SSLHandshakeException: Remote host terminated the handshake
at java.base/sun.security.ssl.SSLSocketImpl.handleEOF(SSLSocketImpl.java:1313)
at java.base/sun.security.ssl.SSLSocketImpl.decode(SSLSocketImpl.java:1152)
at java.base/sun.security.ssl.SSLSocketImpl.readHandshakeRecord(SSLSocketImpl.java:1055)
at java.base/sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:395)
at java.base/sun.security.ssl.SSLSocketImpl.ensureNegotiated(SSLSocketImpl.java:709)
at java.base/sun.security.ssl.SSLSocketImpl$AppOutputStream.write(SSLSocketImpl.java:962)
at java.base/java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:81)
at java.base/java.io.BufferedOutputStream.flush(BufferedOutputStream.java:142)
at java.base/java.io.DataOutputStream.flush(DataOutputStream.java:123)
at com.orientechnologies.orient.enterprise.channel.binary.OChannelBinary.flush(OChannelBinary.java:330)
at com.orientechnologies.orient.server.network.protocol.binary.ONetworkProtocolBinary.config(ONetworkProtocolBinary.java:136)
at com.orientechnologies.orient.server.network.OServerNetworkListener.run(OServerNetworkListener.java:218)
Caused by: java.io.EOFException: SSL peer shut down incorrectly
at java.base/sun.security.ssl.SSLSocketInputRecord.decode(SSLSocketInputRecord.java:167)
at java.base/sun.security.ssl.SSLTransport.decode(SSLTransport.java:108)
at java.base/sun.security.ssl.SSLSocketImpl.decode(SSLSocketImpl.java:1144)
... 10 more

If I use ODatabase to connect either on port 2424 or 2434, there is no problem:

const db = new ODatabase({
host: '127.0.0.1',
port: '2424', // or port: '2434' for ssl
name: 'demo',
username: 'test',
password: 'xxxxxxxxxxx'
});
db.select().from('Store').all().then( async stores => {
console.log( stores )
} )

Are there any limitations when using OrientDBClient with SSL?

In advance thank you very much for the help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant