Skip to main content

Posts

Showing posts with the label sockets

Socket communication between server and client using threads [closed]

I am busy with a project where the client Gui sends user and password details to a server where the details needs to be verified Sever side against the data in the database on the server. We are required to use Threads(from what I understand is that the Server needs to be able to handle multiple requests). Where I get stuck is when the server is started it is set so that is can listen to requests from clients. However the Server gets stuck listening to client requests until it received a request from the client. Furthermore on the client side if I send wrong username and password I struggle to re-submit the info for verification. This is the code that I have used. Would just like to know if I am on the right track? Firstly I start the server. private void butStartUpServerActionPerformed(java.awt.event.ActionEvent evt) { try { Class.forName(driverName); connection = DriverManager.getConnection(SourceURL);

Error Domain=NSPOSIXErrorDomain Code=61 "The operation couldn\u2019t be completed. Connection refused”

I am using asyncSocket as client side, aim running my application on I-Phone simulator, and the server side coded with C#. its working perfectly if i try to connect with a server on my LAN but the connection refused with the server out of my LAN. I'am sure that the same server is working with another client code done on C#. And this the message i get from socket Error: Error Domain=NSPOSIXErrorDomain Code=61 "The operation couldn\u2019t be completed. Connection refused" Knowing that i get this message on connect phase before try to send data to server. Any helping idea is appreciated.

Using two private keys (keystore) and two public keys (truststore) in one SSL Socket Connection

I need to use to key-pair in one socket ssl connection without change nothing in clients. Why? Because one client use a CN attribute in trust store for connection handshake and other clients using another value in the same attribute to process the same task in the same way. So I need to use two key store (private) with distinct CN attributes and also aliases and share two different trust store (public key) with distinct CN attributes and also aliases too. Describing bellow: keyStore1 Keystore type: JKS Keystore provider: SUN ... Alias name: identity1 ... Owner: CN=app1, OU=..., ... Issuer: CN=app1, OU=..., ... ... keyStore2 ... Alias name: identity2 ... Owner: CN=app2, OU=..., ... Issuer: CN=app2, OU=..., ... trustStore1 ... Alias name: identity1 ... Owner: CN=app1, OU=..., ... Issuer: CN=app1, OU=..., ... ... trustStore2 ... Alias name: identity2 ... Owner: CN=app2, OU=..., ... Issuer: CN=app2, OU=..., ... I tried to implement this feature in this way: KeyStore Key