svn commit: r530846 - in /jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl: HostConfigurationWithHostFactory.java HttpHostFactory.java SocketFactoryWrapper
Author: sebb Date: Fri Apr 20 09:18:16 2007 New Revision: 530846 URL: http://svn.apache.org/viewvc?view=revrev=530846 Log: set svn:eol-style native Modified: jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl/HostConfigurationWithHostFactory.java (props changed) jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl/HttpHostFactory.java (props changed) jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl/SocketFactoryWrapper.java (props changed) Propchange: jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl/HostConfigurationWithHostFactory.java -- svn:eol-style = native Propchange: jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl/HttpHostFactory.java -- svn:eol-style = native Propchange: jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl/SocketFactoryWrapper.java -- svn:eol-style = native - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r517699 - in /jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl: HostConfigurationWithHostFactory.java HttpHostFactory.java
Author: olegk Date: Tue Mar 13 06:55:56 2007 New Revision: 517699 URL: http://svn.apache.org/viewvc?view=revrev=517699 Log: HTTPCLIENT-640: HostConfiguration that gets its Host from a factory. This is useful for integrating a specialized Protocol or SocketFactory; for example, a SecureSocketFactory that authenticates via SSL. Use HttpClient.setHostConfiguration to install a HostConfigurationWithHostFactory that contains the specialized HostFactory, Protocol or SocketFactory Contributed by John Kristian jkristian at netflix.com Added: jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl/HostConfigurationWithHostFactory.java (with props) jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl/HttpHostFactory.java (with props) Added: jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl/HostConfigurationWithHostFactory.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl/HostConfigurationWithHostFactory.java?view=autorev=517699 == --- jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl/HostConfigurationWithHostFactory.java (added) +++ jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl/HostConfigurationWithHostFactory.java Tue Mar 13 06:55:56 2007 @@ -0,0 +1,60 @@ +package org.apache.commons.httpclient.contrib.ssl; + +import org.apache.commons.httpclient.HostConfiguration; +import org.apache.commons.httpclient.HttpURL; +import org.apache.commons.httpclient.protocol.Protocol; + +/** + * A kind of HostConfiguration that gets its Host from a factory. This is useful + * for integrating a specialized Protocol or SocketFactory; for example, a + * SecureSocketFactory that authenticates via SSL. Use + * HttpClient.setHostConfiguration to install a HostConfigurationWithHostFactory + * that contains the specialized HostFactory, Protocol or SocketFactory. + * p + * An alternative is to use Protocol.registerProtocol to register a specialized + * Protocol. But that has drawbacks: it makes it hard to integrate modules (e.g. + * web applications in a servlet container) with different strategies, because + * they share the specialized Protocol (Protocol.PROTOCOLS is static). And it + * can't support different Protocols for different hosts or ports (since the + * host and port aren't parameters to Protocol.getProtocol). + * + * @author John Kristian + */ +class HostConfigurationWithHostFactory extends HostConfiguration +{ +public HostConfigurationWithHostFactory(HttpHostFactory factory) +{ +this.factory = factory; +} + +private HostConfigurationWithHostFactory(HostConfigurationWithHostFactory that) +{ +super(that); +this.factory = that.factory; +} + +private final HttpHostFactory factory; + +public Object clone() +{ +return new HostConfigurationWithHostFactory(this); +} + +private static final String DEFAULT_SCHEME = new String(HttpURL.DEFAULT_SCHEME); + +public void setHost(String host) +{ +setHost(host, Protocol.getProtocol(DEFAULT_SCHEME).getDefaultPort()); +} + +public void setHost(final String host, int port) +{ +setHost(host, port, DEFAULT_SCHEME); +} + +public synchronized void setHost(String host, int port, String scheme) +{ +setHost(factory.getHost(this, scheme, host, port)); +} + +} Propchange: jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl/HostConfigurationWithHostFactory.java -- svn:keywords = Date Author Id Revision HeadURL Propchange: jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl/HostConfigurationWithHostFactory.java -- svn:mime-type = text/plain Added: jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl/HttpHostFactory.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl/HttpHostFactory.java?view=autorev=517699 == --- jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl/HttpHostFactory.java (added) +++ jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl/HttpHostFactory.java Tue Mar 13 06:55:56 2007 @@ -0,0 +1,58 @@ +package org.apache.commons.httpclient.contrib.ssl; + +import org.apache.commons.httpclient.HostConfiguration; +import
svn commit: r514390 - in /jakarta/commons/proper/httpclient/trunk: ./ src/contrib/org/apache/commons/httpclient/contrib/ssl/ src/test/org/apache/commons/httpclient/ssl/
Author: oglueck Date: Sun Mar 4 04:37:15 2007 New Revision: 514390 URL: http://svn.apache.org/viewvc?view=revrev=514390 Log: Fixed resource leaks PR: HTTPCLIENT-641 Contributed by Hanson Char Reviewed by Ortwin Glück Modified: jakarta/commons/proper/httpclient/trunk/release_notes.txt jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl/AuthSSLProtocolSocketFactory.java jakarta/commons/proper/httpclient/trunk/src/test/org/apache/commons/httpclient/ssl/SimpleSSLSocketFactory.java jakarta/commons/proper/httpclient/trunk/src/test/org/apache/commons/httpclient/ssl/SimpleSSLTestProtocolSocketFactory.java Modified: jakarta/commons/proper/httpclient/trunk/release_notes.txt URL: http://svn.apache.org/viewvc/jakarta/commons/proper/httpclient/trunk/release_notes.txt?view=diffrev=514390r1=514389r2=514390 == --- jakarta/commons/proper/httpclient/trunk/release_notes.txt (original) +++ jakarta/commons/proper/httpclient/trunk/release_notes.txt Sun Mar 4 04:37:15 2007 @@ -1,4 +1,7 @@ Changes since Release 3.1 Beta 1: +* [HTTPCLIENT-641] - Resource Leakage when loading keystore in AuthSSLProtocolSocketFactory. + Contributed by Hanson Char + * [HTTPCLIENT-634] - Default host config can override scheme of absolute URL. Contributed by John Kristian Modified: jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl/AuthSSLProtocolSocketFactory.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl/AuthSSLProtocolSocketFactory.java?view=diffrev=514390r1=514389r2=514390 == --- jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl/AuthSSLProtocolSocketFactory.java (original) +++ jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl/AuthSSLProtocolSocketFactory.java Sun Mar 4 04:37:15 2007 @@ -31,6 +31,7 @@ package org.apache.commons.httpclient.contrib.ssl; import java.io.IOException; +import java.io.InputStream; import java.net.InetAddress; import java.net.InetSocketAddress; import java.net.Socket; @@ -215,7 +216,13 @@ } LOG.debug(Initializing key store); KeyStore keystore = KeyStore.getInstance(jks); -keystore.load(url.openStream(), password != null ? password.toCharArray(): null); +InputStream is = null; +try { + is = url.openStream(); +keystore.load(is, password != null ? password.toCharArray(): null); +} finally { + if (is != null) is.close(); +} return keystore; } Modified: jakarta/commons/proper/httpclient/trunk/src/test/org/apache/commons/httpclient/ssl/SimpleSSLSocketFactory.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/httpclient/trunk/src/test/org/apache/commons/httpclient/ssl/SimpleSSLSocketFactory.java?view=diffrev=514390r1=514389r2=514390 == --- jakarta/commons/proper/httpclient/trunk/src/test/org/apache/commons/httpclient/ssl/SimpleSSLSocketFactory.java (original) +++ jakarta/commons/proper/httpclient/trunk/src/test/org/apache/commons/httpclient/ssl/SimpleSSLSocketFactory.java Sun Mar 4 04:37:15 2007 @@ -31,6 +31,7 @@ package org.apache.commons.httpclient.ssl; import java.io.IOException; +import java.io.InputStream; import java.net.ServerSocket; import java.net.URL; import java.security.KeyStore; @@ -61,7 +62,13 @@ ClassLoader cl = SimpleSocketFactory.class.getClassLoader(); URL url = cl.getResource(org/apache/commons/httpclient/ssl/simpleserver.keystore); KeyStore keystore = KeyStore.getInstance(jks); -keystore.load(url.openStream(), nopassword.toCharArray()); +InputStream is = null; +try { + is = url.openStream(); + keystore.load(is, nopassword.toCharArray()); +} finally { + if (is != null) is.close(); +} KeyManagerFactory kmfactory = KeyManagerFactory.getInstance( KeyManagerFactory.getDefaultAlgorithm()); kmfactory.init(keystore, nopassword.toCharArray()); Modified: jakarta/commons/proper/httpclient/trunk/src/test/org/apache/commons/httpclient/ssl/SimpleSSLTestProtocolSocketFactory.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/httpclient/trunk/src/test/org/apache/commons/httpclient/ssl/SimpleSSLTestProtocolSocketFactory.java?view=diffrev=514390r1=514389r2=514390 == --- jakarta/commons/proper/httpclient/trunk/src/test/org/apache/commons
svn commit: r509577 - in /jakarta/commons/proper/httpclient/trunk/src: contrib/org/apache/commons/httpclient/contrib/ssl/ java/org/apache/commons/httpclient/ test/org/apache/commons/httpclient/
Author: rolandw Date: Tue Feb 20 06:28:18 2007 New Revision: 509577 URL: http://svn.apache.org/viewvc?view=revrev=509577 Log: HTTPCLIENT-634 Added: jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl/HostConfigurationWithStickyProtocol.java (with props) Modified: jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/HttpClient.java jakarta/commons/proper/httpclient/trunk/src/test/org/apache/commons/httpclient/TestHostConfiguration.java Added: jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl/HostConfigurationWithStickyProtocol.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl/HostConfigurationWithStickyProtocol.java?view=autorev=509577 == --- jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl/HostConfigurationWithStickyProtocol.java (added) +++ jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl/HostConfigurationWithStickyProtocol.java Tue Feb 20 06:28:18 2007 @@ -0,0 +1,69 @@ +package org.apache.commons.httpclient.contrib.ssl; + +import org.apache.commons.httpclient.HostConfiguration; +import org.apache.commons.httpclient.HttpHost; +import org.apache.commons.httpclient.protocol.Protocol; + +/** + * A kind of HostConfiguration that can retain its Protocol when its host name + * or port changes. HttpClient may clone its HostConfigurationWithStickyProtocol + * and change the host URL, without changing the specialized Protocol. + * p + * This is useful for integrating a specialized Protocol or SocketFactory; for + * example, a SecureSocketFactory that authenticates via SSL. Use + * HttpClient.setHostConfiguration to install a + * HostConfigurationWithStickyProtocol that contains the specialized Protocol or + * SocketFactory. + * p + * An alternative is to use Protocol.registerProtocol to register a specialized + * Protocol. But that has drawbacks: it makes it hard to integrate modules (e.g. + * web applications in a servlet container) with different strategies, because + * they share the specialized Protocol (Protocol.PROTOCOLS is static). Also, it + * can't handle multiple socket factories for the same host and port, since the + * URL path isn't a parameter to Protocol.getProtocol or socket factory methods. + * + * @author John Kristian + */ +public class HostConfigurationWithStickyProtocol extends HostConfiguration +{ +public HostConfigurationWithStickyProtocol() +{ +} + +public HostConfigurationWithStickyProtocol(HostConfiguration hostConfiguration) +{ +super(hostConfiguration); +} + +public Object clone() +{ +return new HostConfigurationWithStickyProtocol(this); +} + +public synchronized void setHost(String host, int port, String scheme) +{ +setHost(new HttpHost(host, port, getNewProtocol(host, port, scheme))); +} + +/** + * Select a Protocol to be used for the given host, port and scheme. The + * current Protocol may be selected, if appropriate. This method need not be + * thread-safe; the caller must synchronize if necessary. + * p + * This implementation returns the current Protocol if it has the given + * scheme; otherwise it returns the Protocol registered for that scheme. + */ +protected Protocol getNewProtocol(String host, int port, String scheme) +{ +final Protocol oldProtocol = getProtocol(); +if (oldProtocol != null) { +final String oldScheme = oldProtocol.getScheme(); +if (oldScheme == scheme || (oldScheme != null oldScheme.equalsIgnoreCase(scheme))) { +// The old {rotocol has the desired scheme. +return oldProtocol; // Retain it. +} +} +return Protocol.getProtocol(scheme); +} + +} Propchange: jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl/HostConfigurationWithStickyProtocol.java -- svn:eol-style = native Propchange: jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl/HostConfigurationWithStickyProtocol.java -- svn:keywords = Date Author Id Revision HeadURL Propchange: jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl/HostConfigurationWithStickyProtocol.java -- svn:mime-type = text/plain Modified: jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/HttpClient.java URL: http://svn.apache.org/viewvc
svn commit: r470480 - /jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/proxy/PluginProxyUtil.java
Author: olegk Date: Thu Nov 2 11:16:32 2006 New Revision: 470480 URL: http://svn.apache.org/viewvc?view=revrev=470480 Log: Enabled detection of proxy settings in a browser (applet) for JDK 1.5 and 1.6 Contributed by Jiri Kopsa Jiri.Kopsa at Sun.COM Modified: jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/proxy/PluginProxyUtil.java Modified: jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/proxy/PluginProxyUtil.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/proxy/PluginProxyUtil.java?view=diffrev=470480r1=470479r2=470480 == --- jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/proxy/PluginProxyUtil.java (original) +++ jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/proxy/PluginProxyUtil.java Thu Nov 2 11:16:32 2006 @@ -107,17 +107,15 @@ if (result == null) { invokeFailover = true; } -} else if (javaVers.startsWith(1.4)) { -result = detectProxySettingsJDK14(sampleURL); +} else if (javaVers.startsWith(1.4) || (javaVers.startsWith(1.5) || javaVers.startsWith(1.6))) { +result = detectProxySettingsJDK14_JDK15_JDK16(sampleURL); if (result == null) { invokeFailover = true; } -} else if (javaVers.startsWith(1.5)) { -invokeFailover = true; } else { if (LOG.isDebugEnabled()) { LOG.debug(Sun Plugin reported java version not 1.3.X, + - 1.4.X or 1.5.X - trying failover detection...); + 1.4.X, 1.5.X or 1.6.X - trying failover detection...); } invokeFailover = true; } @@ -220,7 +218,7 @@ * @param sampleURL the URL to check proxy settings for * @return ProxyHost the host and port of the proxy that should be used */ -private static ProxyHost detectProxySettingsJDK14(URL sampleURL) { +private static ProxyHost detectProxySettingsJDK14_JDK15_JDK16(URL sampleURL) { ProxyHost result = null; try { // Look around for the 1.4.X plugin proxy detection class... @@ -232,6 +230,7 @@ new Class[] {URL.class}); Object proxyInfoArrayObj = getProxyInfoMethod.invoke(null, new Object[] {sampleURL}); + if (proxyInfoArrayObj == null || Array.getLength(proxyInfoArrayObj) == 0) { if (LOG.isDebugEnabled()) { @@ -257,6 +256,7 @@ result = new ProxyHost(proxyIP, proxyPort); } } catch (Exception e) { +e.printStackTrace(); LOG.warn(Sun Plugin 1.4.X proxy detection class not found, + will try failover detection, e:+e); } @@ -325,4 +325,4 @@ } return result; } -} +} \ No newline at end of file - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r451784 - /jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl/SocketFactoryWrapper.java
Author: olegk Date: Sun Oct 1 11:55:49 2006 New Revision: 451784 URL: http://svn.apache.org/viewvc?view=revrev=451784 Log: [HTTPCLIENT-601]: SecureProtocolFactoryWrapper class for using the socket factory created by Java Web Start Contributed by Mark Claassen mclaassen at ocie.net Reviewed by Oleg Kalnichevski Roland Weber Added: jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl/SocketFactoryWrapper.java (with props) Added: jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl/SocketFactoryWrapper.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl/SocketFactoryWrapper.java?view=autorev=451784 == --- jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl/SocketFactoryWrapper.java (added) +++ jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl/SocketFactoryWrapper.java Sun Oct 1 11:55:49 2006 @@ -0,0 +1,101 @@ +/* + * $Header$ + * $Revision$ + * $Date$ + * + * + * + * Copyright 2002-2004 The Apache Software Foundation + * + * Licensed under the Apache License, Version 2.0 (the License); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * http://www.apache.org/. + * + */ +package org.apache.commons.httpclient.contrib.ssl; + +import java.io.IOException; +import java.net.InetAddress; +import java.net.InetSocketAddress; +import java.net.Socket; +import java.net.SocketAddress; +import java.net.UnknownHostException; +import javax.net.ssl.SSLSocketFactory; +import org.apache.commons.httpclient.ConnectTimeoutException; +import org.apache.commons.httpclient.params.HttpConnectionParams; +import org.apache.commons.httpclient.protocol.SecureProtocolSocketFactory; + +/** + * Author: Mark Claassen + * p + * Uses some code from EasySSLProtocolSocketFactory.java + * + * p + * Wraps a SSLSocketFactory with a SecureProtocolSocketFactory. + * p + * This was designed to make HttpClient work in situations where an application is being deployed by + * Java Web Start. In these cases, SSL connections are negotiated by webstart implementations of the + * KeyManager and TrustManager. Wrapping the socket factory obtained from + * HttpsURLConnection.getDefaultSocketFactory allows the use of HttpClient while still leveraging + * Java Web Start's handling of SSL certificates + */ +public class SocketFactoryWrapper implements SecureProtocolSocketFactory { + +private SSLSocketFactory socketFactory; + +public SocketFactoryWrapper(SSLSocketFactory socketFactory) { +this.socketFactory = socketFactory; +} + +public Socket createSocket(String host, int port) throws IOException, UnknownHostException { +return socketFactory.createSocket(host, port); +} + +public Socket createSocket(String host, int port, InetAddress localAddress, int localPort) +throws IOException, UnknownHostException { +return socketFactory.createSocket(host, port, localAddress, localPort); +} + +public Socket createSocket( +String host, +int port, InetAddress localAddress, int localPort, +HttpConnectionParams params) throws IOException, UnknownHostException, +ConnectTimeoutException { +// Based on code from EasySSLProtocolSocketFactory.java +Socket rval; +if (params == null) { +throw new IllegalArgumentException(Parameters may not be null); +} +int timeout = params.getConnectionTimeout(); +if (timeout == 0) { +rval = socketFactory.createSocket(host, port, localAddress, localPort); +} else { +rval = socketFactory.createSocket(); +SocketAddress localaddr = new InetSocketAddress(localAddress, localPort); +SocketAddress remoteaddr = new InetSocketAddress(host, port); +rval.bind(localaddr); +rval.connect(remoteaddr, timeout); +} +return rval; +} + +public Socket
svn commit: r410820 - in /jakarta/commons/proper/httpclient/trunk/src: contrib/org/apache/commons/httpclient/contrib/benchmark/ java/org/apache/commons/httpclient/methods/
Author: olegk Date: Thu Jun 1 03:01:33 2006 New Revision: 410820 URL: http://svn.apache.org/viewvc?rev=410820view=rev Log: Added FileRequestEntity class Added: jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/methods/FileRequestEntity.java - copied, changed from r410366, jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/benchmark/FileRequestEntity.java Removed: jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/benchmark/FileRequestEntity.java Modified: jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/benchmark/HttpBenchmark.java Modified: jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/benchmark/HttpBenchmark.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/benchmark/HttpBenchmark.java?rev=410820r1=410819r2=410820view=diff == --- jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/benchmark/HttpBenchmark.java (original) +++ jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/benchmark/HttpBenchmark.java Thu Jun 1 03:01:33 2006 @@ -41,6 +41,7 @@ import org.apache.commons.httpclient.HttpClient; import org.apache.commons.httpclient.HttpMethod; import org.apache.commons.httpclient.HttpVersion; +import org.apache.commons.httpclient.methods.FileRequestEntity; import org.apache.commons.httpclient.methods.GetMethod; import org.apache.commons.httpclient.methods.HeadMethod; import org.apache.commons.httpclient.methods.PostMethod; Copied: jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/methods/FileRequestEntity.java (from r410366, jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/benchmark/FileRequestEntity.java) URL: http://svn.apache.org/viewvc/jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/methods/FileRequestEntity.java?p2=jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/methods/FileRequestEntity.javap1=jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/benchmark/FileRequestEntity.javar1=410366r2=410820rev=410820view=diff == --- jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/benchmark/FileRequestEntity.java (original) +++ jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/methods/FileRequestEntity.java Thu Jun 1 03:01:33 2006 @@ -26,7 +26,7 @@ * http://www.apache.org/. * */ -package org.apache.commons.httpclient.contrib.benchmark; +package org.apache.commons.httpclient.methods; import java.io.File; import java.io.FileInputStream; @@ -36,6 +36,11 @@ import org.apache.commons.httpclient.methods.RequestEntity; +/** + * A RequestEntity that represents a File. + * + * @since 3.1 + */ public class FileRequestEntity implements RequestEntity { final File file; - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r388628 - in /jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/benchmark: ./ BenchmarkWorker.java FileRequestEntity.java HttpBenchmark.java Stats.j
Author: olegk Date: Fri Mar 24 12:36:22 2006 New Revision: 388628 URL: http://svn.apache.org/viewcvs?rev=388628view=rev Log: A simple HTTP benchmark tool based on HttpClient, which implements a subset of AB (Apache Benchmark) interface Backported from Jakarta HttpComponents HttpCore Added: jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/benchmark/ - copied from r388545, jakarta/httpcomponents/trunk/http-core/src/contrib/org/apache/http/contrib/benchmark/ jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/benchmark/FileRequestEntity.java (with props) Modified: jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/benchmark/BenchmarkWorker.java jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/benchmark/HttpBenchmark.java jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/benchmark/Stats.java Modified: jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/benchmark/BenchmarkWorker.java URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/benchmark/BenchmarkWorker.java?rev=388628r1=388545r2=388628view=diff == --- jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/benchmark/BenchmarkWorker.java (original) +++ jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/benchmark/BenchmarkWorker.java Fri Mar 24 12:36:22 2006 @@ -26,87 +26,75 @@ * http://www.apache.org/. * */ -package org.apache.http.contrib.benchmark; +package org.apache.commons.httpclient.contrib.benchmark; import java.io.IOException; import java.io.InputStream; -import org.apache.http.ConnectionReuseStrategy; -import org.apache.http.Header; -import org.apache.http.HttpClientConnection; -import org.apache.http.HttpEntity; -import org.apache.http.HttpException; -import org.apache.http.HttpRequest; -import org.apache.http.HttpResponse; -import org.apache.http.impl.DefaultConnectionReuseStrategy; -import org.apache.http.protocol.HttpRequestExecutor; +import org.apache.commons.httpclient.Header; +import org.apache.commons.httpclient.HostConfiguration; +import org.apache.commons.httpclient.HttpClient; +import org.apache.commons.httpclient.HttpException; +import org.apache.commons.httpclient.HttpMethod; /** - * p - * /p + * pBenchmark worker that can execute an HTTP method given number of times/p + * * @author a href=mailto:oleg at ural.ruOleg Kalnichevski/a * * @version $Revision$ - * - * @since 4.0 */ public class BenchmarkWorker { private byte[] buffer = new byte[4096]; private final int verbosity; -private final HttpRequestExecutor httpexecutor; -private final ConnectionReuseStrategy connstrategy; +private final HttpClient httpexecutor; -public BenchmarkWorker(final HttpRequestExecutor httpexecutor, int verbosity) { +public BenchmarkWorker(final HttpClient httpexecutor, int verbosity) { super(); this.httpexecutor = httpexecutor; -this.connstrategy = new DefaultConnectionReuseStrategy(); this.verbosity = verbosity; } public Stats execute( -final HttpRequest request, -final HttpClientConnection conn, +final HostConfiguration hostconf, +final HttpMethod method, int count, boolean keepalive) throws HttpException { -HttpResponse response = null; Stats stats = new Stats(); stats.start(); for (int i = 0; i count; i++) { try { -response = this.httpexecutor.execute(request, conn); +this.httpexecutor.executeMethod(hostconf, method); if (this.verbosity = 4) { -System.out.println( + request.getRequestLine().toString()); -Header[] headers = request.getAllHeaders(); +System.out.println( + method.getName() + + +method.getURI() + + method.getParams().getVersion()); +Header[] headers = method.getRequestHeaders(); for (int h = 0; h headers.length; h++) { -System.out.println( + headers[h].toString()); +System.out.print( + headers[h].toString()); } System.out.println(); } if (this.verbosity = 3) { - System.out.println(response.getStatusLine().getStatusCode()); +System.out.println(method.getStatusLine().getStatusCode()); } if (this.verbosity = 4
svn commit: r376971 - in /jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl: AuthSSLProtocolSocketFactory.java EasySSLProtocolSocketFactory.java StrictSSLPr
Author: olegk Date: Sat Feb 11 03:57:16 2006 New Revision: 376971 URL: http://svn.apache.org/viewcvs?rev=376971view=rev Log: Changed 'contrib' SSL protocol socket factories to make use of Java 1.4 detached socket support Contributed by Oleg Kalnichevski Modified: jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl/AuthSSLProtocolSocketFactory.java jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl/EasySSLProtocolSocketFactory.java jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl/StrictSSLProtocolSocketFactory.java Modified: jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl/AuthSSLProtocolSocketFactory.java URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl/AuthSSLProtocolSocketFactory.java?rev=376971r1=376970r2=376971view=diff == --- jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl/AuthSSLProtocolSocketFactory.java (original) +++ jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl/AuthSSLProtocolSocketFactory.java Sat Feb 11 03:57:16 2006 @@ -31,7 +31,9 @@ import java.io.IOException; import java.net.InetAddress; +import java.net.InetSocketAddress; import java.net.Socket; +import java.net.SocketAddress; import java.net.URL; import java.net.UnknownHostException; import java.security.GeneralSecurityException; @@ -46,11 +48,11 @@ import org.apache.commons.httpclient.ConnectTimeoutException; import org.apache.commons.httpclient.params.HttpConnectionParams; -import org.apache.commons.httpclient.protocol.ControllerThreadSocketFactory; import org.apache.commons.httpclient.protocol.SecureProtocolSocketFactory; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import javax.net.SocketFactory; import javax.net.ssl.KeyManager; import javax.net.ssl.KeyManagerFactory; import javax.net.ssl.SSLContext; @@ -355,12 +357,16 @@ throw new IllegalArgumentException(Parameters may not be null); } int timeout = params.getConnectionTimeout(); +SocketFactory socketfactory = getSSLContext().getSocketFactory(); if (timeout == 0) { -return createSocket(host, port, localAddress, localPort); +return socketfactory.createSocket(host, port, localAddress, localPort); } else { -// To be eventually deprecated when migrated to Java 1.4 or above -return ControllerThreadSocketFactory.createSocket( -this, host, port, localAddress, localPort, timeout); +Socket socket = socketfactory.createSocket(); +SocketAddress localaddr = new InetSocketAddress(localAddress, localPort); +SocketAddress remoteaddr = new InetSocketAddress(host, port); +socket.bind(localaddr); +socket.connect(remoteaddr, timeout); +return socket; } } Modified: jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl/EasySSLProtocolSocketFactory.java URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl/EasySSLProtocolSocketFactory.java?rev=376971r1=376970r2=376971view=diff == --- jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl/EasySSLProtocolSocketFactory.java (original) +++ jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl/EasySSLProtocolSocketFactory.java Sat Feb 11 03:57:16 2006 @@ -31,17 +31,19 @@ import java.io.IOException; import java.net.InetAddress; +import java.net.InetSocketAddress; import java.net.Socket; +import java.net.SocketAddress; import java.net.UnknownHostException; import org.apache.commons.httpclient.ConnectTimeoutException; import org.apache.commons.httpclient.HttpClientError; import org.apache.commons.httpclient.params.HttpConnectionParams; -import org.apache.commons.httpclient.protocol.ControllerThreadSocketFactory; import org.apache.commons.httpclient.protocol.SecureProtocolSocketFactory; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import javax.net.SocketFactory; import javax.net.ssl.SSLContext; import javax.net.ssl.TrustManager; @@ -175,12 +177,16 @@ throw new IllegalArgumentException(Parameters may not be null); } int timeout = params.getConnectionTimeout(); +SocketFactory socketfactory = getSSLContext().getSocketFactory(); if (timeout == 0) { -return
svn commit: r376972 - /jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl/EasyX509TrustManager.java
Author: olegk Date: Sat Feb 11 04:09:19 2006 New Revision: 376972 URL: http://svn.apache.org/viewcvs?rev=376972view=rev Log: PR #38612 (EasyX509TrustManager no longer checks cert expiry) Contributed by Julius Davies juliusdavies at hotmail.com Reviewed by Oleg Kalnichevski Modified: jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl/EasyX509TrustManager.java Modified: jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl/EasyX509TrustManager.java URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl/EasyX509TrustManager.java?rev=376972r1=376971r2=376972view=diff == --- jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl/EasyX509TrustManager.java (original) +++ jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl/EasyX509TrustManager.java Sat Feb 11 04:09:19 2006 @@ -98,13 +98,7 @@ } } if ((certificates != null) (certificates.length == 1)) { -X509Certificate certificate = certificates[0]; -try { -certificate.checkValidity(); -} -catch (CertificateException e) { -LOG.error(e.toString()); -} +certificates[0].checkValidity(); } else { standardTrustManager.checkServerTrusted(certificates,authType); } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r376695 - in /jakarta/commons/proper/httpclient/trunk: ./ src/contrib/org/apache/commons/httpclient/contrib/auth/
Author: olegk Date: Fri Feb 10 06:11:06 2006 New Revision: 376695 URL: http://svn.apache.org/viewcvs?rev=376695view=rev Log: SPNEGO contrib for httpclient 3.x http://devel.it.su.se/pub/jsp/polopoly.jsp?d=1026a=3329 Contributed by Mikael Wikström mikael.wikstrom at it.su.se Added: jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/auth/ jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/auth/CustomAuthenticationNegotiateExample.java (with props) jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/auth/NegotiateScheme.java (with props) Modified: jakarta/commons/proper/httpclient/trunk/project.xml Modified: jakarta/commons/proper/httpclient/trunk/project.xml URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/httpclient/trunk/project.xml?rev=376695r1=376694r2=376695view=diff == --- jakarta/commons/proper/httpclient/trunk/project.xml (original) +++ jakarta/commons/proper/httpclient/trunk/project.xml Fri Feb 10 06:11:06 2006 @@ -124,6 +124,9 @@ branch tagHTTPCLIENT_2_0_BRANCH/tag /branch +branch + tagHTTPCLIENT_3_0_BRANCH/tag +/branch /branches mailingLists @@ -283,6 +286,10 @@ contributor nameLaura Werner/name emaillaura -at- lwerner.org/email +/contributor +contributor + nameMikael Wilstrom/name + emailmikael.wikstrom -at- it.su.se/email /contributor /contributors Added: jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/auth/CustomAuthenticationNegotiateExample.java URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/auth/CustomAuthenticationNegotiateExample.java?rev=376695view=auto == --- jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/auth/CustomAuthenticationNegotiateExample.java (added) +++ jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/auth/CustomAuthenticationNegotiateExample.java Fri Feb 10 06:11:06 2006 @@ -0,0 +1,116 @@ +/* + * $Header: $ + * $Revision: $ + * $Date: $ + * + * + * + * Copyright 2006 The Apache Software Foundation + * + * Licensed under the Apache License, Version 2.0 (the License); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * http://www.apache.org/. + * + */ +package org.apache.commons.httpclient.contrib.auth; + +import java.util.ArrayList; + +import org.apache.commons.httpclient.Credentials; +import org.apache.commons.httpclient.HttpClient; +import org.apache.commons.httpclient.auth.AuthPolicy; +import org.apache.commons.httpclient.auth.AuthScope; +import org.apache.commons.httpclient.methods.GetMethod; +import org.apache.commons.httpclient.params.DefaultHttpParams; +import org.apache.commons.httpclient.params.HttpParams; + +/** + * A simple custom AuthScheme example. The included auth scheme is meant + * for demonstration purposes only. It does not actually implement a usable + * authentication method. + * + * pre + Login Configuration file bcsLogin.conf for JAAS. + --- + com.sun.security.jgss.initiate { + com.sun.security.auth.module.Krb5LoginModule + required + client=TRUE + useTicketCache=true + ticketCache=${user.krb5cc} + debug=true; + }; + + com.sun.security.jgss.accept { + com.sun.security.auth.module.Krb5LoginModule + required + client=TRUE + useTicketCache=true + ticketCache=${user.krb5cc} + debug=true; + }; + --- + + java -Djava.security.krb5.realm=REALM \ + -Djava.security.krb5.kdc=kdc.domain \ + -Djavax.security.auth.useSubjectCredsOnly=false \ + -Djava.security.auth.login.config=src/conf/bcsLogin.conf \ + -Duser.krb5cc=$KRB5CCNAME \ + -classpath $CP
svn commit: r376759 - /jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl/
Author: olegk Date: Fri Feb 10 08:45:54 2006 New Revision: 376759 URL: http://svn.apache.org/viewcvs?rev=376759view=rev Log: PR #38425 (SSL contrib files do not use standard javax.net.ssl package provided from JDK 1.4.2) Contributed by Christian BOITEL cboitel at lfdj.com Reviewed by Oleg Kalnichevski Modified: jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl/AuthSSLInitializationError.java jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl/AuthSSLProtocolSocketFactory.java jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl/AuthSSLX509TrustManager.java jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl/EasySSLProtocolSocketFactory.java jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl/EasyX509TrustManager.java Modified: jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl/AuthSSLInitializationError.java URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl/AuthSSLInitializationError.java?rev=376759r1=376758r2=376759view=diff == --- jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl/AuthSSLInitializationError.java (original) +++ jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl/AuthSSLInitializationError.java Fri Feb 10 08:45:54 2006 @@ -24,9 +24,6 @@ * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see * http://www.apache.org/. - * - * [Additional notices, if required by prior licensing conditions] - * */ package org.apache.commons.httpclient.contrib.ssl; Modified: jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl/AuthSSLProtocolSocketFactory.java URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl/AuthSSLProtocolSocketFactory.java?rev=376759r1=376758r2=376759view=diff == --- jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl/AuthSSLProtocolSocketFactory.java (original) +++ jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl/AuthSSLProtocolSocketFactory.java Fri Feb 10 08:45:54 2006 @@ -51,12 +51,12 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import com.sun.net.ssl.KeyManager; -import com.sun.net.ssl.KeyManagerFactory; -import com.sun.net.ssl.SSLContext; -import com.sun.net.ssl.TrustManager; -import com.sun.net.ssl.TrustManagerFactory; -import com.sun.net.ssl.X509TrustManager; +import javax.net.ssl.KeyManager; +import javax.net.ssl.KeyManagerFactory; +import javax.net.ssl.SSLContext; +import javax.net.ssl.TrustManager; +import javax.net.ssl.TrustManagerFactory; +import javax.net.ssl.X509TrustManager; /** * p @@ -166,7 +166,7 @@ * p * DISCLAIMER: HttpClient developers DO NOT actively support this component. * The component is provided as a reference material, which may be inappropriate - * to be used without additional customization. + * for use without additional customization. * /p */ Modified: jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl/AuthSSLX509TrustManager.java URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl/AuthSSLX509TrustManager.java?rev=376759r1=376758r2=376759view=diff == --- jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl/AuthSSLX509TrustManager.java (original) +++ jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl/AuthSSLX509TrustManager.java Fri Feb 10 08:45:54 2006 @@ -31,7 +31,8 @@ import java.security.cert.X509Certificate; -import com.sun.net.ssl.X509TrustManager; +import javax.net.ssl.X509TrustManager; +import java.security.cert.CertificateException; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -69,9 +70,9 @@ } /** - * @see com.sun.net.ssl.X509TrustManager#isClientTrusted(X509Certificate[]) + * @see javax.net.ssl.X509TrustManager#checkClientTrusted(X509Certificate[],String authType) */ -public boolean isClientTrusted(X509Certificate[] certificates) { +public void checkClientTrusted(X509Certificate[] certificates,String authType) throws
svn commit: r224453 - /jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/proxy/PluginProxyTestApplet.java
Author: olegk Date: Sat Jul 23 03:36:30 2005 New Revision: 224453 URL: http://svn.apache.org/viewcvs?rev=224453view=rev Log: #getProxyPort and #getProxyHost methods made public Modified: jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/proxy/PluginProxyTestApplet.java Modified: jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/proxy/PluginProxyTestApplet.java URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/proxy/PluginProxyTestApplet.java?rev=224453r1=224452r2=224453view=diff == --- jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/proxy/PluginProxyTestApplet.java (original) +++ jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/proxy/PluginProxyTestApplet.java Sat Jul 23 03:36:30 2005 @@ -166,7 +166,7 @@ } } -private String getProxyHost(String urlString) { +public String getProxyHost(String urlString) { String result = urlString; try { URL url = new URL(urlString); @@ -180,7 +180,7 @@ return result; } -private int getProxyPort(String urlString) { +public int getProxyPort(String urlString) { int result = 80; try { URL url = new URL(urlString); - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r219775 - in /jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/proxy: ./ PluginProxyTest.html PluginProxyTestApplet.java PluginProxyUtil.java ProxyDetectionException.java
Author: olegk Date: Tue Jul 19 14:11:09 2005 New Revision: 219775 URL: http://svn.apache.org/viewcvs?rev=219775view=rev Log: A utility class that gives applets the ability to detect proxy host settings. This was adapted from a post from Chris Forster on 20030227 to a Sun Java forum here: http://forum.java.sun.com/thread.jspa?threadID=364342tstart=120 Contributed by Rob Manning manningr at spamcop.net Added: jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/proxy/ jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/proxy/PluginProxyTest.html (with props) jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/proxy/PluginProxyTestApplet.java (with props) jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/proxy/PluginProxyUtil.java (with props) jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/proxy/ProxyDetectionException.java (with props) Added: jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/proxy/PluginProxyTest.html URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/proxy/PluginProxyTest.html?rev=219775view=auto == --- jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/proxy/PluginProxyTest.html (added) +++ jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/proxy/PluginProxyTest.html Tue Jul 19 14:11:09 2005 @@ -0,0 +1,50 @@ +html +headtitleJava Plugin Proxy Detection Test Applet Page/title/head +body bgcolor=#FF +h1Java Plugin Proxy Detection Test Applet Page/h1 + +hr + +!--CONVERTED_APPLET-- +!-- HTML CONVERTER -- +OBJECT +classid = clsid:8AD9C840-044E-11D1-B3E9-00805F499D93 +codebase = http://java.sun.com/update/1.4.2/jinstall-1_4-windows-i586.cab#Version=1,4,0,0; +WIDTH = 300 HEIGHT = 200 +PARAM NAME = CODE VALUE = PluginProxyTestApplet +PARAM NAME = type VALUE = application/x-java-applet;version=1.4 +PARAM NAME = scriptable VALUE = false +PARAM NAME = bogus VALUE=just testing + +COMMENT + EMBED +type = application/x-java-applet;version=1.4 \ +CODE = PluginProxyTestApplet \ +WIDTH = 300 \ +HEIGHT = 200 \ +bogus =just testing \ + scriptable = false \ + pluginspage = http://java.sun.com/products/plugin/index.html#download; + NOEMBED + +/NOEMBED + /EMBED +/COMMENT +/OBJECT + +!-- +APPLET CODE = PluginProxyTestApplet WIDTH = 300 HEIGHT = 200 +PARAM NAME = bogus VALUE=just testing + + +/APPLET +-- + + +!--END_CONVERTED_APPLET-- + + +hr + +/body +/html \ No newline at end of file Propchange: jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/proxy/PluginProxyTest.html -- svn:keywords = Date Author Id Revision HeadURL Propchange: jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/proxy/PluginProxyTest.html -- svn:mime-type = text/html Added: jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/proxy/PluginProxyTestApplet.java URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/proxy/PluginProxyTestApplet.java?rev=219775view=auto == --- jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/proxy/PluginProxyTestApplet.java (added) +++ jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/proxy/PluginProxyTestApplet.java Tue Jul 19 14:11:09 2005 @@ -0,0 +1,193 @@ +/* + * $HeadURL$ + * $Revision$ + * $Date$ + * + * + * + * Copyright 1999-2004 The Apache Software Foundation + * + * Licensed under the Apache License, Version 2.0 (the License); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License
svn commit: r219776 - in /jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/proxy: PluginProxyTestApplet.java PluginProxyUtil.java ProxyDetectionException.java
Author: olegk Date: Tue Jul 19 14:16:56 2005 New Revision: 219776 URL: http://svn.apache.org/viewcvs?rev=219776view=rev Log: Added scary disclaimer Modified: jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/proxy/PluginProxyTestApplet.java jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/proxy/PluginProxyUtil.java jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/proxy/ProxyDetectionException.java Modified: jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/proxy/PluginProxyTestApplet.java URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/proxy/PluginProxyTestApplet.java?rev=219776r1=219775r2=219776view=diff == --- jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/proxy/PluginProxyTestApplet.java (original) +++ jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/proxy/PluginProxyTestApplet.java Tue Jul 19 14:16:56 2005 @@ -48,7 +48,11 @@ import org.apache.commons.httpclient.ProxyHost; /** - * A description of this class goes here... + * p + * DISCLAIMER: HttpClient developers DO NOT actively support this component. + * The component is provided as a reference material, which may be inappropriate + * for use without additional customization. + * /p */ public class PluginProxyTestApplet extends JApplet { Modified: jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/proxy/PluginProxyUtil.java URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/proxy/PluginProxyUtil.java?rev=219776r1=219775r2=219776view=diff == --- jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/proxy/PluginProxyUtil.java (original) +++ jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/proxy/PluginProxyUtil.java Tue Jul 19 14:16:56 2005 @@ -53,6 +53,12 @@ *a multi-threaded environment. * 4. Add the use of exception to indicate to the caller when proxy detection *failed as opposed to when no proxy is configured. + * + * p + * DISCLAIMER: HttpClient developers DO NOT actively support this component. + * The component is provided as a reference material, which may be inappropriate + * for use without additional customization. + * /p */ public class PluginProxyUtil { Modified: jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/proxy/ProxyDetectionException.java URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/proxy/ProxyDetectionException.java?rev=219776r1=219775r2=219776view=diff == --- jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/proxy/ProxyDetectionException.java (original) +++ jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/proxy/ProxyDetectionException.java Tue Jul 19 14:16:56 2005 @@ -33,6 +33,12 @@ /** * Signals a problem with auto-detecting the proxy information using the java * plugin. + * + * p + * DISCLAIMER: HttpClient developers DO NOT actively support this component. + * The component is provided as a reference material, which may be inappropriate + * for use without additional customization. + * /p */ public class ProxyDetectionException extends Exception { - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [httpclient]contrib
On Mon, 2005-03-07 at 19:07 -0400, Derek Lohnes wrote: I was looking for a jar containing the contrib classes for SSL. Can some tell me what the intention is for this stuff will it be packaged as part of the distribution? Hi Derek, We may eventually consider moving the AuthSSLProtocolSocketFactory http://svn.apache.org/viewcvs.cgi/jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl/AuthSSLProtocolSocketFactory.java?view=markup to HttpClient proper. As to the rest of SSL socket factories in the SSL contrib package, they usually implement a security short-cut or based upon an assumption which may be too application specific and therefore are considered unsafe for general use without a thorough review and modification. If you want to use it do you need to check it out of CVS and build it yourself? This is precisely what we encourage people to do: get the source code, review it carefully, make system specific adjustments. Oleg Thanks Derek - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[httpclient]contrib
I was looking for a jar containing the contrib classes for SSL. Can some tell me what the intention is for this stuff will it be packaged as part of the distribution? If you want to use it do you need to check it out of CVS and build it yourself? Thanks Derek - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-commons/httpclient/src/contrib/org/apache/commons/httpclient/contrib/pool HttpPoolConnectionManager.java HttpPoolConnectionManagerConfiguration.java PoolableHttpConnectionFactory.java
olegk 2004/07/20 11:04:28 Modified:httpclient/src/contrib/org/apache/commons/httpclient/contrib/pool Tag: HTTPCLIENT_2_0_BRANCH HttpPoolConnectionManager.java HttpPoolConnectionManagerConfiguration.java PoolableHttpConnectionFactory.java Log: Fixed minor formatting problems Revision ChangesPath No revision No revision 1.1.2.2 +10 -3 jakarta-commons/httpclient/src/contrib/org/apache/commons/httpclient/contrib/pool/Attic/HttpPoolConnectionManager.java Index: HttpPoolConnectionManager.java === RCS file: /home/cvs/jakarta-commons/httpclient/src/contrib/org/apache/commons/httpclient/contrib/pool/Attic/HttpPoolConnectionManager.java,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -u -r1.1.2.1 -r1.1.2.2 --- HttpPoolConnectionManager.java19 Jul 2004 21:41:09 - 1.1.2.1 +++ HttpPoolConnectionManager.java20 Jul 2004 18:04:27 - 1.1.2.2 @@ -38,6 +38,13 @@ import org.apache.commons.logging.LogFactory; import org.apache.commons.pool.impl.GenericObjectPool; +/** + * p + * DISCLAIMER: HttpClient developers DO NOT actively support this component. + * The component is provided as a reference material, which may be inappropriate + * for use without additional customization. + * /p + */ public class HttpPoolConnectionManager implements HttpConnectionManager { private HashMap poolsMap = new HashMap(); 1.1.2.2 +10 -3 jakarta-commons/httpclient/src/contrib/org/apache/commons/httpclient/contrib/pool/Attic/HttpPoolConnectionManagerConfiguration.java Index: HttpPoolConnectionManagerConfiguration.java === RCS file: /home/cvs/jakarta-commons/httpclient/src/contrib/org/apache/commons/httpclient/contrib/pool/Attic/HttpPoolConnectionManagerConfiguration.java,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -u -r1.1.2.1 -r1.1.2.2 --- HttpPoolConnectionManagerConfiguration.java 19 Jul 2004 21:41:09 - 1.1.2.1 +++ HttpPoolConnectionManagerConfiguration.java 20 Jul 2004 18:04:27 - 1.1.2.2 @@ -29,6 +29,13 @@ import org.apache.commons.pool.impl.GenericObjectPool; +/** + * p + * DISCLAIMER: HttpClient developers DO NOT actively support this component. + * The component is provided as a reference material, which may be inappropriate + * for use without additional customization. + * /p + */ public class HttpPoolConnectionManagerConfiguration { private final long DEFAULT_TIMEOUT = 2000; 1.1.2.2 +10 -3 jakarta-commons/httpclient/src/contrib/org/apache/commons/httpclient/contrib/pool/Attic/PoolableHttpConnectionFactory.java Index: PoolableHttpConnectionFactory.java === RCS file: /home/cvs/jakarta-commons/httpclient/src/contrib/org/apache/commons/httpclient/contrib/pool/Attic/PoolableHttpConnectionFactory.java,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -u -r1.1.2.1 -r1.1.2.2 --- PoolableHttpConnectionFactory.java19 Jul 2004 21:41:09 - 1.1.2.1 +++ PoolableHttpConnectionFactory.java20 Jul 2004 18:04:27 - 1.1.2.2 @@ -33,6 +33,13 @@ import org.apache.commons.logging.LogFactory; import org.apache.commons.pool.PoolableObjectFactory; +/** + * p + * DISCLAIMER: HttpClient developers DO NOT actively support this component. + * The component is provided as a reference material, which may be inappropriate + * for use without additional customization. + * /p + */ public class PoolableHttpConnectionFactory implements PoolableObjectFactory { private HostConfiguration connConf; - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-commons/httpclient/src/contrib/org/apache/commons/httpclient/contrib/pool - New directory
olegk 2004/07/19 14:37:50 jakarta-commons/httpclient/src/contrib/org/apache/commons/httpclient/contrib/pool - New directory - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-commons/httpclient/src/contrib/org/apache/commons/httpclient/contrib/pool HttpPoolConnectionManager.java HttpPoolConnectionManagerConfiguration.java PoolableHttpConnectionFactory.java
olegk 2004/07/19 14:41:09 Added: httpclient/src/contrib/org/apache/commons/httpclient/contrib/pool Tag: HTTPCLIENT_2_0_BRANCH HttpPoolConnectionManager.java HttpPoolConnectionManagerConfiguration.java PoolableHttpConnectionFactory.java Log: MultiThreadedConnectionManager based on commons-pool Contributed by Andrea Fabris cavaliereoscuro -at- email.it Reviewed by Oleg Kalnichevski Revision ChangesPath No revision No revision 1.1.2.1 +167 -0 jakarta-commons/httpclient/src/contrib/org/apache/commons/httpclient/contrib/pool/Attic/HttpPoolConnectionManager.java 1.1.2.1 +155 -0 jakarta-commons/httpclient/src/contrib/org/apache/commons/httpclient/contrib/pool/Attic/HttpPoolConnectionManagerConfiguration.java 1.1.2.1 +98 -0 jakarta-commons/httpclient/src/contrib/org/apache/commons/httpclient/contrib/pool/Attic/PoolableHttpConnectionFactory.java - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-commons/httpclient/src/contrib/org/apache/commons/httpclient/contrib/ssl AuthSSLInitializationError.java AuthSSLProtocolSocketFactory.java AuthSSLX509TrustManager.java EasySSLProtocolSocketFactory.java EasyX509TrustManager.java StrictSSLProtocolSocketFactory.java
olegk 2004/06/09 14:07:41 Modified:httpclient/src/contrib/org/apache/commons/httpclient/contrib/ssl Tag: HTTPCLIENT_2_0_BRANCH EasySSLProtocolSocketFactory.java EasyX509TrustManager.java StrictSSLProtocolSocketFactory.java Added: httpclient/src/contrib/org/apache/commons/httpclient/contrib/ssl Tag: HTTPCLIENT_2_0_BRANCH AuthSSLInitializationError.java AuthSSLProtocolSocketFactory.java AuthSSLX509TrustManager.java Log: Contribution of an SSL authenticating socket factory Contributed by Oleg Kalnichevski Reviewed by Michael Becke Revision ChangesPath No revision No revision 1.2.2.2 +44 -25 jakarta-commons/httpclient/src/contrib/org/apache/commons/httpclient/contrib/ssl/EasySSLProtocolSocketFactory.java Index: EasySSLProtocolSocketFactory.java === RCS file: /home/cvs/jakarta-commons/httpclient/src/contrib/org/apache/commons/httpclient/contrib/ssl/EasySSLProtocolSocketFactory.java,v retrieving revision 1.2.2.1 retrieving revision 1.2.2.2 diff -u -r1.2.2.1 -r1.2.2.2 --- EasySSLProtocolSocketFactory.java 22 Feb 2004 18:21:12 - 1.2.2.1 +++ EasySSLProtocolSocketFactory.java 9 Jun 2004 21:07:41 - 1.2.2.2 @@ -21,8 +21,6 @@ * information on the Apache Software Foundation, please see * http://www.apache.org/. * - * [Additional notices, if required by prior licensing conditions] - * */ package org.apache.commons.httpclient.contrib.ssl; @@ -31,15 +29,14 @@ import java.net.InetAddress; import java.net.Socket; import java.net.UnknownHostException; -import javax.net.ssl.SSLSocketFactory; - -import com.sun.net.ssl.SSLContext; -import com.sun.net.ssl.TrustManager; import org.apache.commons.httpclient.protocol.SecureProtocolSocketFactory; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import com.sun.net.ssl.SSLContext; +import com.sun.net.ssl.TrustManager; + /** * p * EasySSLProtocolSocketFactory can be used to creats SSL [EMAIL PROTECTED] Socket}s @@ -51,12 +48,38 @@ * you are perfectly aware of security implications of accepting * self-signed certificates * /p + * + * p + * Example of using custom protocol socket factory for a specific host: + * pre + * Protocol easyhttps = new Protocol(https, new EasySSLProtocolSocketFactory(), 443); + * + * HttpClient client = new HttpClient(); + * client.getHostConfiguration().setHost(localhost, 443, easyhttps); + * // use relative url only + * GetMethod httpget = new GetMethod(/); + * client.executeMethod(httpget); + * /pre + * /p + * p + * Example of using custom protocol socket factory per default instead of the standard one: + * pre + * Protocol easyhttps = new Protocol(https, new EasySSLProtocolSocketFactory(), 443); + * Protocol.registerProtocol(https, easyhttps); + * + * HttpClient client = new HttpClient(); + * GetMethod httpget = new GetMethod(https://localhost/;); + * client.executeMethod(httpget); + * /pre + * /p * * @author a href=mailto:[EMAIL PROTECTED]Oleg Kalnichevski/a * + * p * DISCLAIMER: HttpClient developers DO NOT actively support this component. * The component is provided as a reference material, which may be inappropriate - * to be used without additional customization. + * for use without additional customization. + * /p */ public class EasySSLProtocolSocketFactory implements SecureProtocolSocketFactory { @@ -64,38 +87,35 @@ /** Log object for this class. */ private static final Log LOG = LogFactory.getLog(EasySSLProtocolSocketFactory.class); +private SSLContext sslcontext = null; + /** * Constructor for EasySSLProtocolSocketFactory. - * - * Code sample: - * - * blockquote - * Protocol easyhttps = new Protocol( - * https, new EasySSLProtocolSocketFactory(), 443); - * - * HttpClient client = new HttpClient(); - * client.getHostConfiguration().setHost(localhost, 443, easyhttps); - * /blockquote */ public EasySSLProtocolSocketFactory() { super(); } -private static SSLSocketFactory getEasySSLSocketFactory() { -SSLContext context = null; +private static SSLContext createEasySSLContext() { try { -context = SSLContext.getInstance(SSL); +SSLContext context = SSLContext.getInstance(SSL); context.init( null, new TrustManager
cvs commit: jakarta-commons/httpclient/src/contrib/org/apache/commons/httpclient/contrib/methods - New directory
adrian 2003/06/26 03:25:56 jakarta-commons/httpclient/src/contrib/org/apache/commons/httpclient/contrib/methods - New directory - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-commons/httpclient/src/contrib/org/apache/commons/httpclient/contrib/methods/multipart - New directory
adrian 2003/06/26 03:25:56 jakarta-commons/httpclient/src/contrib/org/apache/commons/httpclient/contrib/methods/multipart - New directory - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-commons/httpclient/src/contrib/org/apache/commons/httpclient/contrib/methods/multipart ContentType.java ContentTypeFilePart.java
adrian 2003/06/26 03:27:56 Added: httpclient/src/contrib/org/apache/commons/httpclient/contrib/methods/multipart ContentType.java ContentTypeFilePart.java Log: Added classes for detecting the content type. PR: Bug 20986 Submitted by: Eric Devlin with modifications from Adrian Sutton Revision ChangesPath 1.1 jakarta-commons/httpclient/src/contrib/org/apache/commons/httpclient/contrib/methods/multipart/ContentType.java Index: ContentType.java === /* * * * The Apache Software License, Version 1.1 * * Copyright (c) 2002-2003 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright *notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright *notice, this list of conditions and the following disclaimer in *the documentation and/or other materials provided with the *distribution. * * 3. The end-user documentation included with the redistribution, if *any, must include the following acknowlegement: * This product includes software developed by the *Apache Software Foundation (http://www.apache.org/). *Alternately, this acknowlegement may appear in the software itself, *if and wherever such third-party acknowlegements normally appear. * * 4. The names The Jakarta Project, Commons, and Apache Software *Foundation must not be used to endorse or promote products derived *from this software without prior written permission. For written *permission, please contact [EMAIL PROTECTED] * * 5. Products derived from this software may not be called Apache *nor may Apache appear in their names without prior written *permission of the Apache Group. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see * lt;http://www.apache.org/gt;. * * [Additional notices, if required by prior licensing conditions] * */ package org.apache.commons.httpclient.contrib.methods.multipart; import java.io.File; /** * This class provides mappings from file name extensions to content types. * * @author a href=mailto:[EMAIL PROTECTED]Eric Devlin/a * @author a href=mailto:[EMAIL PROTECTED]Adrian Sutton/a * * @version $Revision: 1.1 $ * * DISCLAIMER: HttpClient developers DO NOT actively support this component. * The component is provided as a reference material, which may be inappropriate * to be used without additional customization. */ public final class ContentType { /** Mime Type mappings 'liberated' from Tomcat4.1.18/conf/web.xml*/ public static final String[][] MIME_TYPE_MAPPINGS = { { abs, audio/x-mpeg }, { ai, application/postscript }, { aif, audio/x-aiff }, { aifc, audio/x-aiff }, { aiff, audio/x-aiff }, { aim, application/x-aim }, { art, image/x-jg }, { asf, video/x-ms-asf }, { asx, video/x-ms-asf }, { au, audio/basic }, { avi, video/x-msvideo }, { avx, video/x-rad-screenplay }, { bcpio, application/x-bcpio }, { bin, application/octet-stream }, { bmp, image/bmp }, { body, text/html }, { cdf, application/x-cdf }, { cer, application/x-x509-ca-cert }, { class, application/java }, { cpio, application/x-cpio
AW: HttpClient contrib package established
Hi, I have a samplog program that logs in to a Suse FaxMail Server with a PostMethod and then executes a GetMethod. It seems that the HttpClient hangs after executing the get in the method HttpParser.readRawLine(). I'm using the latest nightly sourcedrop. Thanks in advance, Thomas The log: 2003/03/26 09:25:35:398 CET [TRACE] GetMethod - -enter GetMethod(String) 2003/03/26 09:25:35:398 CET [TRACE] PostMethod - -enter PostMethod.setRequestBody(NameValuePair[]) 2003/03/26 09:25:35:398 CET [TRACE] HttpMethod - -enter getContentCharSet( Header contentheader ) 2003/03/26 09:25:35:398 CET [DEBUG] HttpMethod - -Default charset used: ISO-8859-1 2003/03/26 09:25:35:498 CET [TRACE] PostMethod - -enter PostMethod.generateRequestBody(NameValuePair[]) 2003/03/26 09:25:35:518 CET [TRACE] EntityEnclosingMethod - -enter EntityEnclosingMethod.setRequestBody(String) 2003/03/26 09:25:35:518 CET [TRACE] HttpMethod - -enter getContentCharSet( Header contentheader ) 2003/03/26 09:25:35:518 CET [DEBUG] HttpMethod - -Default charset used: ISO-8859-1 2003/03/26 09:25:35:518 CET [TRACE] HttpClient - -enter HttpClient.executeMethod(HttpMethod) 2003/03/26 09:25:35:528 CET [TRACE] HttpClient - -enter HttpClient.executeMethod(HostConfiguration,HttpMethod) 2003/03/26 09:25:35:628 CET [DEBUG] HttpConnection - -creating connection for testserver:80 via null:-1 using protocol: http:80 2003/03/26 09:25:35:628 CET [DEBUG] HttpConnection - -HttpConnection.setSoTimeout(0) 2003/03/26 09:25:35:628 CET [TRACE] HttpConnection - -enter HttpConnection.open() 2003/03/26 09:25:35:739 CET [TRACE] HttpMethod - -enter HttpMethodBase.execute(HttpState, HttpConnection) 2003/03/26 09:25:35:809 CET [TRACE] Authenticator - -enter Authenticator.authenticate(HttpMethod, HttpState) 2003/03/26 09:25:35:839 CET [TRACE] Authenticator - -enter Authenticator.authenticate(HttpMethod, HttpState, Header, String) 2003/03/26 09:25:35:839 CET [DEBUG] HttpMethod - -Execute loop try 1 2003/03/26 09:25:35:839 CET [TRACE] HttpMethod - -enter HttpMethodBase.processRequest(HttpState, HttpConnection) 2003/03/26 09:25:35:839 CET [TRACE] HttpMethod - -Attempt number 1 to write request 2003/03/26 09:25:35:849 CET [TRACE] HttpMethod - -enter HttpMethodBase.writeRequest(HttpState, HttpConnection) 2003/03/26 09:25:35:849 CET [TRACE] HttpMethod - -enter HttpMethodBase.writeRequestLine(HttpState, HttpConnection) 2003/03/26 09:25:35:849 CET [TRACE] HttpMethod - -enter HttpMethodBase.generateRequestLine(HttpConnection, String, String, String, String) 2003/03/26 09:25:35:869 CET [DEBUG] wire - - POST /perl/login.pl HTTP/1.1[\r][\n] 2003/03/26 09:25:35:869 CET [TRACE] HttpConnection - -enter HttpConnection.print(String) 2003/03/26 09:25:35:869 CET [TRACE] HttpConnection - -enter HttpConnection.write(byte[]) 2003/03/26 09:25:35:869 CET [TRACE] HttpConnection - -enter HttpConnection.write(byte[], int, int) 2003/03/26 09:25:35:959 CET [TRACE] HttpMethod - -enter HttpMethodBase.writeRequestHeaders(HttpState,HttpConnection) 2003/03/26 09:25:35:959 CET [TRACE] ExpectContinueMethod - -enter ExpectContinueMethod.addRequestHeaders(HttpState, HttpConnection) 2003/03/26 09:25:35:959 CET [TRACE] HttpMethod - -enter HttpMethodBase.addRequestHeaders(HttpState, HttpConnection) 2003/03/26 09:25:35:969 CET [TRACE] HttpMethod - -enter HttpMethodBase.addUserAgentRequestHeaders(HttpState, HttpConnection) 2003/03/26 09:25:35:969 CET [TRACE] HttpMethod - -enter HttpMethodBase.addHostRequestHeader(HttpState, HttpConnection) 2003/03/26 09:25:35:979 CET [DEBUG] HttpMethod - -Adding Host request header 2003/03/26 09:25:35:979 CET [TRACE] HttpMethod - -enter HttpMethodBase.addCookieRequestHeader(HttpState, HttpConnection) 2003/03/26 09:25:36:179 CET [TRACE] HttpState - -enter HttpState.getCookies() 2003/03/26 09:25:36:179 CET [TRACE] CookieSpec - -enter CookieSpecBase.match(String, int, String, boolean, Cookie[]) 2003/03/26 09:25:36:179 CET [TRACE] HttpMethod - -enter HttpMethodBase.addAuthorizationRequestHeader(HttpState, HttpConnection) 2003/03/26 09:25:36:179 CET [TRACE] HttpMethod - -enter HttpMethodBase.addProxyAuthorizationRequestHeader(HttpState, HttpConnection) 2003/03/26 09:25:36:269 CET [TRACE] HttpMethod - -enter HttpMethodBase.addContentLengthRequestHeader(HttpState, HttpConnection) 2003/03/26 09:25:36:269 CET [TRACE] EntityEnclosingMethod - -enter EntityEnclosingMethod.getRequestContentLength() 2003/03/26 09:25:36:269 CET [TRACE] EntityEnclosingMethod - -enter EntityEnclosingMethod.bufferContent() 2003/03/26 09:25:36:359 CET [DEBUG] wire - - User-Agent: Jakarta Commons-HttpClient/2.0alpha3[\r][\n] 2003/03/26 09:25:36:359 CET [TRACE] HttpConnection - -enter HttpConnection.print(String) 2003/03/26 09:25:36:359 CET [TRACE] HttpConnection - -enter HttpConnection.write(byte[]) 2003/03/26 09:25:36:359 CET [TRACE] HttpConnection - -enter HttpConnection.write(byte[], int, int) 2003/03/26 09:25:36:369 CET [DEBUG] wire - - Host: testserver[\r][\n] 2003/03/26
RE: HttpClient contrib package established
Thomas The web server reported as Apache/1.3.19 (Unix) (SuSE/Linux) mod_ssl/2.8.3 OpenSSL/0.9.6a mod_perl/1.25 fails to respond to the GET request at all. HttpClient hangs while waiting for a response status line. 2003/03/26 09:25:37:661 CET [TRACE] HttpMethod - -enter HttpMethodBase.readResponse(HttpState, HttpConnection) 2003/03/26 09:25:37:671 CET [TRACE] HttpMethod - -enter HttpMethodBase.readStatusLine(HttpState, HttpConnection) 2003/03/26 09:25:37:671 CET [TRACE] HttpConnection - -enter HttpConnection.readLine() 2003/03/26 09:25:37:671 CET [TRACE] HttpParser - -enter HttpParser.readLine() 2003/03/26 09:25:37:671 CET [TRACE] HttpParser - -enter HttpParser.readRawLine() The problem appears to be on the server side. Please examine the web server's logs to find out the cause. Oleg - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
AW: HttpClient contrib package established
Yes, I think it's a server problem, but it's now also a problem for the client because it hangs forever. Is there a possibility to set a timeout? -Ursprüngliche Nachricht- Von: Kalnichevski, Oleg [mailto:[EMAIL PROTECTED] Gesendet: Mittwoch, 26. März 2003 10:42 An: Commons HttpClient Project Betreff: RE: HttpClient contrib package established Thomas The web server reported as Apache/1.3.19 (Unix) (SuSE/Linux) mod_ssl/2.8.3 OpenSSL/0.9.6a mod_perl/1.25 fails to respond to the GET request at all. HttpClient hangs while waiting for a response status line. 2003/03/26 09:25:37:661 CET [TRACE] HttpMethod - -enter HttpMethodBase.readResponse(HttpState, HttpConnection) 2003/03/26 09:25:37:671 CET [TRACE] HttpMethod - -enter HttpMethodBase.readStatusLine(HttpState, HttpConnection) 2003/03/26 09:25:37:671 CET [TRACE] HttpConnection - -enter HttpConnection.readLine() 2003/03/26 09:25:37:671 CET [TRACE] HttpParser - -enter HttpParser.readLine() 2003/03/26 09:25:37:671 CET [TRACE] HttpParser - -enter HttpParser.readRawLine() The problem appears to be on the server side. Please examine the web server's logs to find out the cause. Oleg - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: HttpClient contrib package established
Sure. HttpClient#setTimeout(int) -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Mittwoch, 26. März 2003 10:47 To: [EMAIL PROTECTED] Subject: AW: HttpClient contrib package established Yes, I think it's a server problem, but it's now also a problem for the client because it hangs forever. Is there a possibility to set a timeout? -Ursprüngliche Nachricht- Von: Kalnichevski, Oleg [mailto:[EMAIL PROTECTED] Gesendet: Mittwoch, 26. März 2003 10:42 An: Commons HttpClient Project Betreff: RE: HttpClient contrib package established Thomas The web server reported as Apache/1.3.19 (Unix) (SuSE/Linux) mod_ssl/2.8.3 OpenSSL/0.9.6a mod_perl/1.25 fails to respond to the GET request at all. HttpClient hangs while waiting for a response status line. 2003/03/26 09:25:37:661 CET [TRACE] HttpMethod - -enter HttpMethodBase.readResponse(HttpState, HttpConnection) 2003/03/26 09:25:37:671 CET [TRACE] HttpMethod - -enter HttpMethodBase.readStatusLine(HttpState, HttpConnection) 2003/03/26 09:25:37:671 CET [TRACE] HttpConnection - -enter HttpConnection.readLine() 2003/03/26 09:25:37:671 CET [TRACE] HttpParser - -enter HttpParser.readLine() 2003/03/26 09:25:37:671 CET [TRACE] HttpParser - -enter HttpParser.readRawLine() The problem appears to be on the server side. Please examine the web server's logs to find out the cause. Oleg - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-commons/httpclient/src/contrib/org/apache/commons/httpclient/contrib - New directory
olegk 2003/03/16 04:36:58 jakarta-commons/httpclient/src/contrib/org/apache/commons/httpclient/contrib - New directory - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-commons/httpclient/src/contrib/org/apache/commons/httpclient/contrib/ssl - New directory
olegk 2003/03/16 04:36:58 jakarta-commons/httpclient/src/contrib/org/apache/commons/httpclient/contrib/ssl - New directory - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-commons/httpclient/src/contrib/org/apache/commons/httpclient/contrib/utils - New directory
olegk 2003/03/16 04:36:58 jakarta-commons/httpclient/src/contrib/org/apache/commons/httpclient/contrib/utils - New directory - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-commons/httpclient/src/contrib/org/apache/commons/httpclient/contrib/utils HttpMethodCloner.java
olegk 2003/03/16 04:39:34 Added: httpclient/src/contrib/org/apache/commons/httpclient/contrib/ssl EasySSLProtocolSocketFactory.java EasyX509TrustManager.java httpclient/src/contrib/org/apache/commons/httpclient/contrib/utils HttpMethodCloner.java Log: Changelog: - HttpClient Contribution package established - HttpMethodCloner contributed by Thomas Mathis. This utility can be used to create exact copies of objects that implement HttpMethod interface - EasySSLProtocolSocketFactory EasyX509TrustManager contributed by Adrian Sutton Oleg Kalnichevski. EasySSLProtocolSocketFactory can be used to create SSL sockets that accept self-signed certificates when communicating with HTTP servers over SSL Reviews by Oleg Kalnichevski Revision ChangesPath 1.1 jakarta-commons/httpclient/src/contrib/org/apache/commons/httpclient/contrib/ssl/EasySSLProtocolSocketFactory.java Index: EasySSLProtocolSocketFactory.java === /* * * * The Apache Software License, Version 1.1 * * Copyright (c) 2002-2003 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright *notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright *notice, this list of conditions and the following disclaimer in *the documentation and/or other materials provided with the *distribution. * * 3. The end-user documentation included with the redistribution, if *any, must include the following acknowlegement: * This product includes software developed by the *Apache Software Foundation (http://www.apache.org/). *Alternately, this acknowlegement may appear in the software itself, *if and wherever such third-party acknowlegements normally appear. * * 4. The names The Jakarta Project, Commons, and Apache Software *Foundation must not be used to endorse or promote products derived *from this software without prior written permission. For written *permission, please contact [EMAIL PROTECTED] * * 5. Products derived from this software may not be called Apache *nor may Apache appear in their names without prior written *permission of the Apache Group. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see * http://www.apache.org/. * * [Additional notices, if required by prior licensing conditions] * */ package org.apache.commons.httpclient.contrib.ssl; import java.io.IOException; import java.net.InetAddress; import java.net.Socket; import java.net.UnknownHostException; import java.security.KeyManagementException; import java.security.NoSuchAlgorithmException; import javax.net.ssl.SSLSocket; import javax.net.ssl.SSLSocketFactory; import com.sun.net.ssl.SSLContext; import com.sun.net.ssl.TrustManager; import org.apache.commons.httpclient.protocol.SecureProtocolSocketFactory; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; /** * p * EasySSLProtocolSocketFactory can be used to creats SSL [EMAIL PROTECTED] Socket}s * that accept self-signed certificates. * /p * p * This socket factory SHOULD NOT be used for productive systems * due to security reasons, unless it is a concious decision and * you are perfectly aware of security implications of accepting * self-signed certificates * /p * * @author
HttpClient contrib package established
Folks I have taken liberty of committing the very first components to the our muck spoken about HttpClient contribution package. I have to say it has become a bit of a problem that patches cannot be posted as attachments to the mailing list. So, even though I am perfectly aware of the fact that these components have not been thoroughly reviewed, I could not think of a better way of making them available for review (apart from creating a fake bug report or mailing them directly to all HttpClient contributors). I hope you all find this compromise justified Cheers Oleg - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]