-
Notifications
You must be signed in to change notification settings - Fork 600
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Native Image of an application with SSHJ fails to reach a settlement upon SSH handshake #858
Comments
There was also such a problem after I converted the code to .jar :( |
@noblehelm I submitted pull request #861 to address the Bouncy Castle registration issue. Part of the problem with the current approach is that the default configuration requires Bouncy Castle to be registered in order to configure most of the standard algorithms. It may be possible to make it work with custom configuration that adds the necessary algorithm factories, but the changes in the referenced pull request should provide additional options. |
@exceptionfactory I must be doing something wrong because even with the pull request I'm still having the same problem:
This is the following configuration I have in the pom.xml with the native-maven-plugin: <plugin>
<groupId>org.graalvm.buildtools</groupId>
<artifactId>native-maven-plugin</artifactId>
<configuration>
<outputDirectory>${project.build.directory}/boot</outputDirectory>
<requiredVersion>22.3</requiredVersion>
<skipNativeTests>true</skipNativeTests>
<buildArgs>
<arg>--no-fallback</arg>
<arg>--enable-all-security-services</arg>
<arg>--features=com.my.company.BouncyCastleFeature</arg>
<arg>--initialize-at-build-time=org.bouncycastle.crypto.prng.SP800SecureRandom</arg>
<arg>--initialize-at-build-time=org.bouncycastle.jcajce.provider.drbg.DRBG$Default</arg>
<arg>--initialize-at-build-time=org.bouncycastle.jcajce.provider.drbg.DRBG$NonceAndIV</arg>
</buildArgs>
</configuration>
<executions>
<execution>
<id>build-image</id>
<goals>
<goal>compile-no-fork</goal>
</goals>
</execution>
</executions>
</plugin> and the following BouncyCastleFeature class: public class BouncyCastleFeature implements Feature {
@Override
public void beforeAnalysis(BeforeAnalysisAccess access) {
RuntimeClassInitialization.initializeAtBuildTime("org.bouncycastle");
Security.addProvider(new BouncyCastleProvider());
}
} |
@noblehelm The logs indicate that the changes in the pull request are not being used. As mentioned in the PR, the |
@exceptionfactory Yeah, Imma dumbnut and forgot that in addition to |
No problem @noblehelm, glad to hear the changes worked! |
While trying to build a GraalVM native image of a project with SSHJ as dependency, and running it to create an SSH connection with whatever equipment, the SSH handshake fails because there is no algorithm to choose, due to missing BouncyCastle support. I've tried implementing #828 locally to see if it could fix, but the problem still continued (and seemed unrelated).
Note.: The image and log below are missing two SSHJ log messages (that indicate that BouncyCastle is not registered and could not be registered) because of the #828 local implementation. With or without the patch applied, the error remains the same.
Anyone have an idea of what is happening, and how fix it?
The text was updated successfully, but these errors were encountered: