Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Unable to read from SSLSocket
I am getting the following exception when I try to read after having
connected to a SSL enabled FTP server:

main, handling exception: javax.net.ssl.SSLException: Unrecognized SSL
message, plaintext connection?
main, SEND TLSv1 ALERT:  fatal, description = unexpected_message
main, WRITE: TLSv1 Alert, length = 2
main, called closeSocket()
javax.net.ssl.SSLException: Unrecognized SSL message, plaintext
connection?


I have created a SSLSocket like this:
ctx = SSLContext.getInstance("TLS");
ctx.init(kmf.getKeyManagers(), tmf.getTrustManagers(), null);
SSLSocketFactory m_sslSocketFactory = ctx.getSocketFactory();
SSLSocket sslSocket =(SSLSocket)m_sslSocketFactory.createSocket("stdevt09",
1990);

After creating Socket I am able to print out the enabled cipher suites
so I am assuming that the connection was eshtablished successfully but
while reading from socket stream there is a problem.

Thanks in Advance,
Swatantra

Report this thread to moderator Post Follow-up to this message
Old Post
Sonu
12-28-04 02:12 PM


Re: Unable to read from SSLSocket
Swatantra,

Are you sure that the FTP server that you are connecting to is SSL
enabled and not SSH enabled? The commonly known "SFTP" is SSH enabled -
not SSL enabled. SSH and SSL are not the same; hence the java SSL APIs
will not work in such a situation.

-Ranga

Sonu wrote:
> I am getting the following exception when I try to read after having
> connected to a SSL enabled FTP server:
>
> main, handling exception: javax.net.ssl.SSLException: Unrecognized
SSL
> message, plaintext connection?
> main, SEND TLSv1 ALERT:  fatal, description = unexpected_message
> main, WRITE: TLSv1 Alert, length = 2
> main, called closeSocket()
> javax.net.ssl.SSLException: Unrecognized SSL message, plaintext
> connection?
>
>
> I have created a SSLSocket like this:
> ctx = SSLContext.getInstance("TLS");
> ctx.init(kmf.getKeyManagers(), tmf.getTrustManagers(), null);
> SSLSocketFactory m_sslSocketFactory = ctx.getSocketFactory();
> SSLSocket sslSocket
=(SSLSocket)m_sslSocketFactory.createSocket("stdevt09",
> 1990);
>
> After creating Socket I am able to print out the enabled cipher
suites
> so I am assuming that the connection was eshtablished successfully
but
> while reading from socket stream there is a problem.
>
> Thanks in Advance,
> Swatantra


Report this thread to moderator Post Follow-up to this message
Old Post
Ranga
12-29-04 09:00 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Java Security archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 08:31 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.