| 2001-02-18 | updated miniSSL V1.3:
- objects are now reusable.
- SSL2 did not connect properly.
| 2000-11-15 | updated miniSSL V1.2: improved handling of closure alerts.
|
| 2000-11-13 | released miniSSL V1.1 (bugfix)
|
| 2000-09-05 | first public release of miniSSL 1.0
| <p id="example" />
Example
/******************************************************************************
* $Source: /export/CVS/bebbo/www.bebbosoft.de/tools/minissl/index.wiki,v $
* $Revision: 1.14 $
* $Date: 2011/08/14 18:47:32 $
* $Author: bebbo $
* $Locker: $
* $State: Exp $
*
* Copyright (c) by Stefan Bebbo Franke 1999-2000.
* All rights reserved
*
* test for SslClient
*
* Based on http://home.netscape.com/eng/ssl3/draft302.txt
*****************************************************************************/
import de.bb.minissl.*;
import java.net.*;
import java.io.*;
public class Client {
/**
* create a client connection to some server
*/
public static void main(String args[]) {
System.out.println("SSL Client Demo $Revision: 1.14 $");
int port = 443;
switch (args.length) {
case 2: port = Integer.parseInt(args[1]);
case 1: break;
default:
System.out.println("usage: Client &91;=80]");
return;
}
String ip = args[0];
try {
System.out.println("connecting to: " + ip + ":" + port);
Socket socket = new Socket(ip, port);
SslClient ssl = new SslClient(socket.getInputStream(), socket.getOutputStream());
System.out.println("using ciphertype " + ssl.getCipherType());
InputStream is = ssl.getInputStream();
OutputStream os = ssl.getOutputStream();
// now use the streams ...
os.write("GET / HTTP/1.0\r\n\r\n".getBytes() );
ByteArrayOutputStream bos = new ByteArrayOutputStream();
for (int i = is.read(); i >= 0; i = is.read())
bos.write(i);
System.out.println(bos.toString());
} catch (IOException e) {
System.out.println(e.toString());
}
}
}
/*
* Revision 1.1 2000/09/25 12:21:10 bebbo
* @N repackaged
*/
<p id="disclaimer" />
Disclaimer of Warranty
Software is provided "AS IS," without a warranty of any kind. You may use it on your own risk.
|