Modified: trunk/jopenssl/src/java/org/jruby/ext/openssl/X509Name.java (834 => 835)
--- trunk/jopenssl/src/java/org/jruby/ext/openssl/X509Name.java 2007-12-13 04:14:46 UTC (rev 834)
+++ trunk/jopenssl/src/java/org/jruby/ext/openssl/X509Name.java 2007-12-13 19:27:02 UTC (rev 835)
@@ -53,10 +53,8 @@
import org.jruby.RubyModule;
import org.jruby.RubyNumeric;
import org.jruby.RubyObject;
-import org.jruby.RubyObjectAdapter;
import org.jruby.RubyString;
import org.jruby.exceptions.RaiseException;
-import org.jruby.javasupport.JavaEmbedUtils;
import org.jruby.runtime.Block;
import org.jruby.runtime.CallbackFactory;
import org.jruby.runtime.ObjectAllocator;
@@ -97,14 +95,13 @@
cX509Name.setConstant("DEFAULT_OBJECT_TYPE",runtime.newFixnum(DERTags.UTF8_STRING));
RubyHash hash = new RubyHash(runtime, runtime.newFixnum(DERTags.UTF8_STRING));
- RubyObjectAdapter api = JavaEmbedUtils.newObjectAdapter();
- api.callMethod(hash, "[]=", new IRubyObject[] {runtime.newString("C"), runtime.newFixnum(DERTags.PRINTABLE_STRING)});
- api.callMethod(hash, "[]=", new IRubyObject[] {runtime.newString("countryName"),runtime.newFixnum(DERTags.PRINTABLE_STRING)});
- api.callMethod(hash, "[]=", new IRubyObject[] {runtime.newString("serialNumber"),runtime.newFixnum(DERTags.PRINTABLE_STRING)});
- api.callMethod(hash, "[]=", new IRubyObject[] {runtime.newString("dnQualifier"),runtime.newFixnum(DERTags.PRINTABLE_STRING)});
- api.callMethod(hash, "[]=", new IRubyObject[] {runtime.newString("DC"),runtime.newFixnum(DERTags.IA5_STRING)});
- api.callMethod(hash, "[]=", new IRubyObject[] {runtime.newString("domainComponent"),runtime.newFixnum(DERTags.IA5_STRING)});
- api.callMethod(hash, "[]=", new IRubyObject[] {runtime.newString("emailAddress"),runtime.newFixnum(DERTags.IA5_STRING)});
+ hash.op_aset(runtime.newString("C"),runtime.newFixnum(DERTags.PRINTABLE_STRING));
+ hash.op_aset(runtime.newString("countryName"),runtime.newFixnum(DERTags.PRINTABLE_STRING));
+ hash.op_aset(runtime.newString("serialNumber"),runtime.newFixnum(DERTags.PRINTABLE_STRING));
+ hash.op_aset(runtime.newString("dnQualifier"),runtime.newFixnum(DERTags.PRINTABLE_STRING));
+ hash.op_aset(runtime.newString("DC"),runtime.newFixnum(DERTags.IA5_STRING));
+ hash.op_aset(runtime.newString("domainComponent"),runtime.newFixnum(DERTags.IA5_STRING));
+ hash.op_aset(runtime.newString("emailAddress"),runtime.newFixnum(DERTags.IA5_STRING));
cX509Name.setConstant("OBJECT_TYPE_TEMPLATE", hash);
}
Modified: trunk/jopenssl/src/java/org/jruby/ext/openssl/x509store/X509_STORE_CTX.java (834 => 835)
--- trunk/jopenssl/src/java/org/jruby/ext/openssl/x509store/X509_STORE_CTX.java 2007-12-13 04:14:46 UTC (rev 834)
+++ trunk/jopenssl/src/java/org/jruby/ext/openssl/x509store/X509_STORE_CTX.java 2007-12-13 19:27:02 UTC (rev 835)
@@ -625,8 +625,12 @@
cb = verify_cb;
must_be_ca = -1;
- if(System.getenv("OPENSSL_ALLOW_PROXY_CERTS") != null && !"false".equalsIgnoreCase((String)System.getenv("OPENSSL_ALLOW_PROXY_CERTS"))) {
- allow_proxy_certs = 1;
+ try {
+ if (System.getenv("OPENSSL_ALLOW_PROXY_CERTS") != null && !"false".equalsIgnoreCase((String) System.getenv("OPENSSL_ALLOW_PROXY_CERTS"))) {
+ allow_proxy_certs = 1;
+ }
+ } catch (Error e) {
+ // just ignore if we can't use System.getenv
}
for(int i = 0; i<last_untrusted;i++) {