Skip to content

Commit

Permalink
Fix X500PrincipalUtil to avoid method handles in native image
Browse files Browse the repository at this point in the history
  • Loading branch information
dmlloyd authored and stuartwdouglas committed Mar 6, 2019
1 parent 85026c7 commit 0943a0b
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package io.quarkus.runtime.graal;

import java.lang.invoke.MethodHandle;
import java.security.Principal;

import javax.security.auth.x500.X500Principal;

import org.wildfly.security.x500.util.X500PrincipalUtil;

import com.oracle.svm.core.annotate.Alias;
import com.oracle.svm.core.annotate.Delete;
import com.oracle.svm.core.annotate.RecomputeFieldValue;
import com.oracle.svm.core.annotate.Substitute;
import com.oracle.svm.core.annotate.TargetClass;

/**
*
*/
@TargetClass(X500PrincipalUtil.class)
final class Target_org_wildfly_security_x500_util_X500PrincipalUtil {
@RecomputeFieldValue(kind = RecomputeFieldValue.Kind.Reset)
@Alias
static Class<?> X500_NAME_CLASS;
@Delete
static MethodHandle AS_X500_PRINCIPAL_HANDLE;

@Substitute
public static X500Principal asX500Principal(Principal principal, boolean convert) {
return null;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ public RuntimeValue<Undertow> startUndertow(ShutdownContext shutdown, Deployment

if (undertow == null) {
SSLContext context = config.ssl.toSSLContext();
doServerStart(config, launchMode, context);
doServerStart(config, launchMode, context);

if (launchMode != LaunchMode.DEVELOPMENT) {
//in development mode undertow should not be shut down
Expand Down

0 comments on commit 0943a0b

Please sign in to comment.