ssl « Socket « Java Network Q&A

Java Network Q&A
Java Network Q&A » Socket » ssl 

1. Which Cipher Suites to enable for SSL Socket?

I'm using Java's SSLSocket to secure communications between a client and a server program. The server program also serves up HTTPS requests from web browsers. According to "Beginning Cryptography with ...

2. SSLSockets and problem with Cipher Specs

I'm trying to get my java client to communicate with a C server using SSL. The problem is - I don't have any server sources and I'm getting a handshake failure error:

Exception ...

3. Getting EOFException while trying to read from SSLSocket

I am developing a SSL client that will do a simple request to a SSL server and wait for the response. The SSL handshake and the writing goes OK but I ...

4. Who can help me about this SSL exception?

Sorry, don't look at the following words, this is just because my stupidness, nevermind. I am trying to run a very simple server/client ssl code with a self generated keystore file. I ...

5. SOCKS5 Proxy using SSLSocket

I have a client/server application that remotely connects to a server via Java's SSLSocket. I'm trying to implement an optional mode that enables connections via an authenticated SOCKS v5 proxy. I tried using ...

6. Is it possible to change plain socket to SSLSocket?

There is a plain socket server listening on port 12345;

ServerSocket s = new ServerSocket(12345);
What I want to know is that it is possible that:
  1. If the client send a http request, the ...

7. Why do I get the error "Cannot store non-PrivateKeys" when creating an SSL Socket in Java?

I am working on an older IBM iSeries (IBM-i, i5OS, AS/400, etc), with a Java 5 JVM (Classic, not ITJ J9) on O/S version V5R3M0. Here is the scenario in a nutshell:

  1. I ...

8. How do I use SSLSockets instead of standard Sockets with Java apps

I'm trying to use ssl sockets in a working java networking program. I replaced two lines of code

        //Socket socket = new Socket(ipAddress, port);

9. how to do ssl socket programming

I am doing socket communication through follwing IP address it working but no i want to do communication in ssl mode but how can i cahnge InetAddress serverAddr = InetAddress.getByName(""); ...

10. SSL/TSL using CocoaAsyncSockets and Java Sockets

I want to create a socket server in cocoa, using AsyncSockets and connect with Java. Enabling SSL works if Java is the server and cocoa the client, but I require the ...

11. Java / SSL Server Socket

I am writing an application that will accept LDAP queries via port 636, do some non ldap stuff, and then hand back an ldap looking response. I'm a bit new to Java ...

12. Can I use both PrintWriter and BufferedOutputStream on the same outputstream?

Can I use both PrintWriter and BufferedOutputStream on the same outputstream? The situation is this: I'm having a SSLSocket program and I want to be able to transfer both Strings and byte [] ...

13. SSL Sockets in Java

I want to secure comunication in my application using SSL. I am using org.apache.commons.ssl and OpenSSL. I have created key and crt like this (those are self signed for now):

openssl req ...

14. Baby in SSL

16. SSL Implementation NA-weird exception

17. SSL and MSIE

I use Apache 1.3.19, Tomcat and mod_ssl,OpenSSL ( mod_jk too). After creating a self-signed certificat, my application, a reports generator, works fine with Netscape. With MSIE, i can't access to RTF reports, an error " Internet Explorer can not open this internet site" occurs. With TXT and HTML formats, it works...... Very strange,... perhaps due to conflict between content type and ...

18. SSL sockets - adapter class

I am trying to write class that implements SSL Sockets instead of regular Sockets when using RMI. I have class that is adapter and now I have a problem: How can I convert (easy way) SSL socket to regular one. Can I just cast it (I don't think so) or do I have implement all methods from Socket class?

19. SSL with Sockets ???

I am doing a application and applet so that my client would have a easier way to handle his client information. It askes the server for custmer address , phone, name and credit card info. It easier to just use a bowser interface to do this. But client don't like it. The Security of applet is up and running every other ...

20. SSL implementation not available ?

21. Jabber and SSL?

I'm probably jumping the gun somewhat given this week's giveaway here, but I thought I'd ask this as soon as it occurred to me. My current employer works on a military base, and as part of our security requirements, we're not allowed to run instant messaging clients due to the insecurity in communicating through an off-site server. This complicates things oftentimes, ...

22. What's problem with this SSL Socket??

23. SSL implementation not available

Hi Jose. Some questions. 1. Which version of the JDK are you using? If you'r enot using 1.4+, you'll need to get the JSSE package. If you're using 1.4, JSSE is part of it. 2. The error you're getting is at compilation or runtime? What is the error, exactly? 3. Are you sure you imported*?

24. non-blocking IO and SSL

25. Need Advice on creating a server that uses SSL!

Hi! I am trying to make a MUD server, client, (and protocol) that use SSL for communication... I've read some info on SSL and certificates and stuff, but I am still confused about the whole system... What I want from SSL is: the name (adv. purposes), and the "secure connection" - so nobody can see what you send to server, or ...

26. fastest ssl implementation ?

Hi there ! Wondering, if somebody has some experiences with different ssl implementations? Is there a "fastest" one or is there a benchmark avaible? I'm currently using Sun's JSSE but I've heared of other implementations like IAIK ISaSiLK, Phaos SSLava, Baltimore J/SSL and DSTC JCSI (Java Crypto and Security Implementation). Can someone help me for that matter? Greetings ... - Thomas ...

27. ssl performance

Howdy ! Sorry for annoying you again, but this question is (hopefully) a very simple one How much slower is HTTPs compared to HTTP? I'm stressing my JETTY server with several Post requests and file uploads. In some cases HTTPs is up to 6 times slower than HTTP. Especially if JETTY has to handle multiple client requests at the same time. ...

28. Default SSL context init failed: null

29. Need to implement persistent SSL in java

I need to send data from a client app to a IIS webserver. I have set in my code all the necessary stuff needed for persistent ssL, but the socket still closes. I have used both jdk1.3 and jdk1.4 but to no avail. Here's a sample of my code : ========================================================= HttpURLConnection con = (HttpURLConnection)new URL(urlAddress).openConnection(); con.setRequestProperty ("Authorization", "Basic " + ...

31. SSL tunnel

32. DOUBT in SSL

33. Help required in SSL

34. Default SSL context init failed: null

35. untrusted server cert chain

Hi All, I am trying connect to webserver using https from apche HttpClient. I created keystore and placed in server. The same configured in server.xml too. If I am invoking through browser its working fine. but if i try to invoke through HttpClient its throwing following exception. Pls help me in this regards. at at at at ...

36. SSL tunneling

Hello: I'm making a Proxy server and I have a problem with the SSL tunneling. This is the secuence I use: 1. Read de socket information from the client 2. If I receive a CONNECT servername:443 HTTP/1.0... then 3. I open a secure conection with the server using the Microsoft's SslStream for .Net 4. If the conection is stablished then 5. ...

37. SSL Sockets

Hello All, I have an SSL Server running on a specific port ( an SSLServer Socket ). A thread tries to connect to the SSL Server through SSL socket . if I compile and run (manually) both the client and the server using the following command KeySupplierThreads 49238733875757031469947520093949205704676148001284687056573126602014569163677 100209 ( for the client ) java ARUMASSLServer 5000 1 ...

38. SSL Reading Problem in server-side

Hi guys, I have a problem in my server implemetation with SSL Server Socket. I have created a server socket with a specfic port and bind address. Whenever a client connecfed, i grap its inputstream and starts to read as bytes. There is no problem to open server socket and certifacate authorization, and also a client successfully connects to server. But ...

39. SSL setup

I'm looking for guidance on creating an SSL connection with or without server authentication. Where is a good place to go? I find the Sun example somewhat confusing and not workable from behind a firewall. For now I'm just looking for something where I can simulate client and server on my local machine.


41. ssl socket direction

42. How do I get a hold of Java's default SSL Trust Manager?

You can follow the following link: The following code is copied from the above link and is what you want: class MyX509TrustManager implements X509TrustManager { /* * The default X509TrustManager returned by SunX509. We'll delegate * decisions to it, and fall back to the logic in this class if the * default X509TrustManager doesn't trust it. */ X509TrustManager sunJSSEX509TrustManager; MyX509TrustManager() ...

43. Issue with SSL connectivity

Hi All, I am trying to establish a secure connection to another server. I have the required certificates imported to keystore and listing the keystore shows me the proper aliases. However, when i connect to the remote server, I am getting a 403 response and the folks at the server side say that my request does not have any certificates. Please ...

44. using SSL by System.setproperty optionally

Hello All, I have a struts app in which i use an object to send soap messages (axis2) with or without ssl (input is an url). I thought i could make it optional by setting the properties or not. The point is to get an ssl recv error if a call is made to a web service that requires clientauthentication ...

45. WLST over SSL

[I have also posted this in the weblogic forum, not sure where it should go] Hi there I have successfully executed a WLST script over an SSL connection to perform operations such as deploy/undeploy EAR files and configure resources. I imported the demo certificate from my BEA install into my client JVM to achieve this. I now want to specify the ...

46. How does SSL work behind the scenes

Hello... I had to write a client to pull a file from a server with an HTTPS url ... I wrote a simple http client with authentication headers for userid and password.... It worked for me... I read about SSL and found out that HTTPS is not so simple as HTTP and a lot of authentication happens behind the scenes .... ...

47. bad record MAC -- HELP!

I got this exception with SSL connection. Sometimes after the handshake completes and it stays connected for 5 mins, this exception happens and SSL connection is dropped. I have a read method that takes the ByteBuffer inNetData, decrypts the data and puts to ByteBuffer inData. public boolean readMessage( SSLEngine sslEngine, SocketChannel sc, ByteBuffer inNetData, ByteBuffer inData, ByteBuffer appData) throws Exception { ...

48. SSL Handshake Issue

Hi All, I managed to found the answer. It is required to set the system property to explicitly load the cacerts file,security provider and protocol type. System.setProperty("java.protocol.handler.pkgs",""); System.setProperty("","/jre/lib/security/cacerts");//Path of Cacerts file Security.addProvider(new; Without setting this properties, if we try to access the https url using httpclient it works in an inconsistent manner. Explicit loading works. Thanks, Regards, Maruthi

50. Adding SSL to an existing server/client

I've been working on a client/server for my company for the last month or so. Its pretty much done except for testing and some minor tweaks. My company writes IVR software and what I'm writing is basically an alert type system so that if something goes wrong, then the right people receive an alert (kinda like an IM) on top of ...

51. Plain socket to SSL

Are you sure they are the same? What does "System.out.println(socket.getClass())" print out? Try the following example: import*; import*; public class Test { public static void main(String[] args) throws Exception { SSLSocketFactory factory = (SSLSocketFactory)SSLSocketFactory.getDefault(); print(factory.getClass(), 0); Socket socket = new Socket("", 443); print(socket.getClass(), 0); socket = factory.createSocket(socket, "", 443, true); print(socket.getClass(), 0); socket.close(); } private static void print(Class cls, ...

52. SSL error

I have a Web Service deployed in Glassfish for which I have created a WS Client to invoke the WS methods. I have another java application from which I invoke a Web Service method using the WS client and then I invoke a Secure Web Service using a third party application. The application fails to connect to the Secure Web Service ...

53. SSL via proxy

55. untrusted server cert chain

Hi All, I hope I can get some help with the above error. The background is I have two different URL's connections( A and B) in my application. They both call a different secured server requesting data. The error below is always returned when the second request is being made. If I run request A first the request completes fine. But ...

56. SSL Socket Stopped Working with Java1.6

BufferedReader _in = null; PrintWriter _out = null; SSLSocket _dataSocket = null; SSLSocket _sslClient = null; SSLSocketFactory _factory = null; public void connect(String host, int port) throws IOException { Security.setProperty("ssl.SocketFactory.provider", ""); Security.setProperty("ssl.ServerSocketFactory.provider", ""); _factory = (SSLSocketFactory)SSLSocketFactory.getDefault(); _sslClient = (SSLSocket)_factory.createSocket(host, port); _sslClient.setEnableSessionCreation(true); _sslClient.setUseClientMode(true); _sslClient.setKeepAlive(true); _out = new PrintWriter(_sslClient.getOutputStream(), true); _in = new BufferedReader(new InputStreamReader(_sslClient.getInputStream())); }

57. SSL server requirements

58. java.lang.RuntimeException: peer not authenticated

When we use HTTPS protocol, the server sends back its certificate which then gets verified with the trusted certs at client side. In HTTP connection this does not happen, which is why it works in your case. I think in your case your client machine might not have server's cert as a trusted cert. Check your keystore.

59. Start SSL socket

60. Programming SSL sockets

Hi! I need to write client-server application. They must use SSLSockets to communicate with each other. I know that I need a SSL certificate (am I right?). So I have one certificate. What's next? I have to write them as usual client-server unsave applications but instead of Socket and ServerSocket I must use SSLSocket and SSLServerSocket? Can anybody provide any sample ...

61. SSL Socket application

1. Find out what is your machine IP address. Probably something like 192.168.x.y. 2. Go to your router and follow the instructions on how to configure "port forwarding" or "network address translation". 3. Go to It will tell you what is your external (visible from the Internet) IP address. 4. The client should use this address. Note that you external ...

62. SSL Socket Programming.

Hi guy's , I think I'm on a way to the solution here. When I've got the SSLException, i take a look at my socket session, And I can figure that the session is no longer valid. So because of that , we got the sslException . Does anybody know how to renew the socket session in an applet. regards, chris. ...  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.