TLS and ECHO
noe <[email protected]> Tue, 26 Oct 2004 14:17:09 +0200
| Newsgroups | gmane.network.beep.beepcore.java.general |
|---|---|
| Message-ID | <[email protected]> |
Is this a valid piece of code? Can I have a session secured with
TLSProfile and then have a channel again with TLSProfile as in below?
Or it is not meaningfull to do both?
If I only choose to secure the session but not a channel everything is
ok but when i try to do both(for session and channel) it gives me
errors, plus if i choose to establish a channel with TLS like without a
session TLS i again get errors!
I am confused about this problem .
I am using java version "1.4.2_06" and I have put the path for all
the necessary jar files. Looks like not problem on installation and
classpathing.
Thanks for reading!
sample code is taken from BeepCore Java example:
try {
session =
TLSProfile.getDefaultInstance().startTLS((TCPSession) session);
} catch (BEEPException e) {
System.err.println("bing: Error unable to start
TLS.\n\t" +
e.getMessage());
if (privacy == PRIVACY_REQUIRED)
return;
}
}
// Start a channel for the echo profile
Channel channel;
try {
//channel = session.startChannel(EchoProfile.ECHO_URI);
channel = session.startChannel(TLSProfile.URI);
//I added this line and it never works
} catch (BEEPError e) {
if (e.getCode() == 550) {
System.err.println("bing: Error host does not
support " +
"echo
profile"); // or TLS profile
}
-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl