title: OpenJDK on OpenShift: "NoSuchAlgorithmException: EC AlgorithmParameters not available"
body: <p>I'm running into <code>java.security.NoSuchAlgorithmException: EC AlgorithmParameters not available</code> with Wildfly 8.2 (OpenJDK 1.8.0_31) on OpenShift (the exception is thrown by <code>AmazonHttpClient</code>). </p>
  
  <p>It looks like there is a bug with OpenJDK 1.8 and ECC:
  <a href="https://bugzilla.redhat.com/show_bug.cgi?id=1167153" rel="nofollow noreferrer">https://bugzilla.redhat.com/show_bug.cgi?id=1167153</a></p>
  
  <p>On of the suggested workarounds requires editing <code>jre/lib/security/java.security</code> to disable <code>jdk.tls.disabledAlgorithms=EC,ECDHE,ECDH</code>. 
  Or removing <code>jre/lib/ext/sunec.jar</code></p>
  
  <p>Unfortunately I'm not able to do this on OpenShift (missing permissions).</p>
  
  <p>What would be the best workaround here? Can I alternatively switch to Oracle JDK (on OpenShift) which does not have this problem? </p>
  
  <p><strong>UPDATE</strong>:</p>
  
  <p>I removed Sun java.security.Provider-s and added BouncyCastle instead:</p>
  
  <pre><code>static {
    Security.removeProvider("SunEC");
    Security.removeProvider("SUN");
    Security.removeProvider("SunJSSE");
    // ...
    Security.addProvider(new BouncyCastleProvider());
  }
  </code></pre>
  
  <p>Unfortunately BouncyCastle is <em>not</em> a JSSE provider (<a href="https://stackoverflow.com/questions/23906736">create an SSLContext instance using a Bouncy Castle provider</a>) and
  <code>SSLContext.getInstance()</code> fails with 
  <code>NoSuchAlgorithmException: TLS SSLContext not available</code>.</p>
  
  <p>I also tried @Rudy De Busscher suggested answer, although I'm not in favor of manual setting
  the env variable since it's something that can later easily be forgotten.
  Instead, I added the <code>JAVA_OPTS_EXT</code> setting to <code>$OPENSHIFT_DATA_DIR/.my_custom_env</code>
  and loaded it with <code>source ${OPENSHIFT_DATA_DIR}.my_custom_env</code> in 
  the <code>.openshift/action_hooks/pre_start</code> hook.
  It didn't worked but since I would still need to use BouncyCastle for JSSE, I have given up this solution.</p>
  
  <p>Fortunatelly I was able to switch back to OpenJDK 1.7 (via <code>.openshift/markers/java7</code>)
  which "solved" the problem for now.</p>