Ok, I just submitted a patch for this. I hope that GUMP should build happily
now :-)
+ /** Log object for this class. */
+ private static final Log log = LogFactory.getLog(NTLM.class);
+
+ //Initialize the security provider
+ static {
+ //TODO: do not use System properties
+ String secProviderName = System.getProperty(
+ "httpclient.security.provider",
+ "com.sun.crypto.provider.SunJCE");
+ try {
+ java.security.Provider secProvider = (java.security.Provider)
+ Class.forName(secProviderName).newInstance();
+ Security.addProvider(secProvider);
+ } catch (ClassNotFoundException e) {
+ log.error("Specified security provider " + secProviderName +
+ " could not be found by the class loader", e);
+ } catch (ClassCastException e) {
+ log.error("Specified security provider " + secProviderName +
+ " is not of type java.security.Provider", e);
+ } catch (InstantiationException e) {
+ log.error("Specified security provider " + secProviderName +
+ " could not be instantiated", e);
+ } catch (IllegalAccessException e) {
+ log.error("Specified security provider " + secProviderName +
+ " does not allow access to the constructor", e);
+ }
+ }
Dennis Cook wrote:
> How about something like the following:
>
> String secProviderClass =
> System.getProperty("httpclient.security.provider","org.bouncycastle.jce.prov
> ider.BouncyCastleProvider");
> java.security.Provider = (java.security.Provider)
> Class.forName(secProviderClass).newInstance();
> Security.addProvider(new
> org.bouncycastle.jce.provider.BouncyCastleProvider());
>
> Dennis Cook
> BeVocal, Inc.
> tel: 650-641-1424
> fax: 650-210-9275
>
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
> Behalf Of Jeff Dever
> Sent: Friday, September 27, 2002 6:24 PM
> To: Jakarta Commons Developers List
> Subject: Re: [GUMP][httpclient] Build Failure - commons-httpclient
>
> Stefan,
>
> I guess we could fix this by replacing the offending line with:
>
> Security.addProvider(new
> org.bouncycastle.jce.provider.BouncyCastleProvider());
>
> So that the BouncyCastle implementation is used instead, but that should not
> be forced on us. At the moment Adrian is the only one using
> NTLM authentication and he wants the SunJCE provider.
>
> I do not know how to choose one dynamicly at compile time in java (in C++
> I'd check a #define and do a conditional compilation). Perhaps a
> Any suggestions from the java build gurus on how to accomplish this?
>
> If this is not feasable, can we get the SunJCE added to the GUMP build
> environment?
>
> >
> > No, in the Gump descriptor (I've already done so), but a problem
> > remains for me (Gump uses bouncycastle's JCE implementation):
> >
> > [javac]
> /home/bodewig/dev/gump/jakarta-commons/httpclient/src/java/org/apache/common
> s/httpclient/NTLM.java:91: cannot resolve symbol
> > [javac] symbol : class SunJCE
> > [javac] location: package provider
> > [javac] Security.addProvider(new
> com.sun.crypto.provider.SunJCE());
> > [javac]
> ^
> > [javac] 1 error
> >
> > can you make that independent of the Sun implementation?
> >
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>