sslengine.example | Java server and client using JSSE SSLEngine | TLS library
kandi X-RAY | sslengine.example Summary
kandi X-RAY | sslengine.example Summary
JSSE is the standard way Java provides to implement SSL/TLS communication. One of its core classes is SSLContext, which you can easily configure and equally easily get an input and output stream from. These streams though will be blocking, since available() will always return false for SSL/TLS connections. In order to achieve a non-blocking SSL/TLS solution, JSSE provides the SSLEngine, which leads to a more complicated solution, since the developer has to implement parts of the protocol himself and also decide the way the transport link will be implemented. Due to the lack of examples I was able to find in the Internet, I decided to start a project, in order to explore JSSE, and share it here. More information about JSSE can be found in this link:
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Starts the server
- Reads data from the socket channel
- Sends a message back to the client
- Handles a new connection request
- Handles the end of a stream
- Determines if the server is active or not
- Establishes a connection to the remote server
- Creates an SSL handshake between two peers
- Checks if there is a buffer under the current session
- Enlarges the buffer with the given capacity
- Enlarges the application buffer size
- Enlarges the session buffer size
- Creates and returns the key managers required for a file
- Creates the trust managers required to initiate a JKS context
- Closes the connection
- Stops the server
sslengine.example Key Features
sslengine.example Examples and Code Snippets
Community Discussions
Trending Discussions on sslengine.example
QUESTION
I'm working on a client / server application. Client and server connect via NIO and the connection is secured by SSL. I based my architecture on this GitHub Project.
Right now KeyStore and TrustStore (for client and server) are stored as resources to my project and loaded when they are needed during the connection process.
Is this a secure solution?
If I was to publish the application that would mean every copy of client and server would be using the same KeyStore and TrustStore. This would make things very simple. But is it safe?
The alternative solution would be to have the end user manage their certificates themselves which seems overly complicated.
EDIT:
Clarification: Client and server are mutually authenticating. They each have their own private key.
...ANSWER
Answered 2019-Feb-06 at 22:17Using the same key for server and client means that the clients will be able to impersonate the server. In most cases where TLS is used, this is usually undesirable. It only makes sense when you fully control both server and client side.
If you're going to use the same certificate for client and server, you're essentially not really benefitting from asymmetric cryptography. Your system may be much simpler if you just use symmetric key, like with TLS-PSK.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install sslengine.example
You can use sslengine.example like any standard Java library. Please include the the jar files in your classpath. You can also use any IDE and you can run and debug the sslengine.example component as you would do with any other Java program. Best practice is to use a build tool that supports dependency management such as Maven or Gradle. For Maven installation, please refer maven.apache.org. For Gradle installation, please refer gradle.org .
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page