diff --git a/core/java/src/net/i2p/crypto/DirKeyRing.java b/core/java/src/net/i2p/crypto/DirKeyRing.java
index 38ba45bf8e2f6480fe05b00b678336fa2fcb506a..cc840b36e796d730de755622f0e3a10e198fbf34 100644
--- a/core/java/src/net/i2p/crypto/DirKeyRing.java
+++ b/core/java/src/net/i2p/crypto/DirKeyRing.java
@@ -61,6 +61,9 @@ class DirKeyRing implements KeyRing {
                     throw new GeneralSecurityException("CN mismatch: " + cn);
             }
             return cert.getPublicKey();
+        } catch (IllegalArgumentException iae) {
+            // java 1.8.0_40-b10, openSUSE
+            throw new GeneralSecurityException("Bad cert", iae);
         } finally {
             try { if (fis != null) fis.close(); } catch (IOException foo) {}
         }
diff --git a/core/java/src/net/i2p/crypto/KeyStoreUtil.java b/core/java/src/net/i2p/crypto/KeyStoreUtil.java
index 3cd641ad684a81a4c7ecd7cadc6185a23f4b7701..c374ad1204a15ffaa90d7e2af5f282082a2e5b47 100644
--- a/core/java/src/net/i2p/crypto/KeyStoreUtil.java
+++ b/core/java/src/net/i2p/crypto/KeyStoreUtil.java
@@ -248,6 +248,12 @@ public class KeyStoreUtil {
         } catch (IOException ioe) {
             error("Error reading X509 Certificate: " + file.getAbsolutePath(), ioe);
             return false;
+        } catch (IllegalArgumentException iae) {
+            // java 1.8.0_40-b10, openSUSE
+            // Exception in thread "main" java.lang.IllegalArgumentException: Input byte array has wrong 4-byte ending unit
+            // at java.util.Base64$Decoder.decode0(Base64.java:704)
+            error("Error reading X509 Certificate: " + file.getAbsolutePath(), iae);
+            return false;
         } finally {
             try { if (fis != null) fis.close(); } catch (IOException foo) {}
         }
diff --git a/core/java/src/net/i2p/crypto/SU3File.java b/core/java/src/net/i2p/crypto/SU3File.java
index 0f0b6efd3f8ccd4cd31b1ce92409a5331b9f9915..bc4d0251c7f105cc4cd1ec8cc79900631f410de8 100644
--- a/core/java/src/net/i2p/crypto/SU3File.java
+++ b/core/java/src/net/i2p/crypto/SU3File.java
@@ -980,6 +980,11 @@ public class SU3File {
             IOException ioe = new IOException("cert error");
             ioe.initCause(gse);
             throw ioe;
+        } catch (IllegalArgumentException iae) {
+            // java 1.8.0_40-b10, openSUSE
+            IOException ioe = new IOException("cert error");
+            ioe.initCause(iae);
+            throw ioe;
         } finally {
             try { if (fis != null) fis.close(); } catch (IOException foo) {}
         }