Configuring the SpiffeProvider in java.security is not adding the Provider
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 35/100
Hướng nghiên cứu
Bắt đầu bằng cách tái hiện việc khởi chạy JAR thực thi của Spring Boot với tệp java.security được nêu và so sánh với lần chạy bằng IntelliJ. Theo dõi quá trình nạp provider xung quanh SpiffeProvider.install() và lỗi của KeyStore.getInstance, chỉ sử dụng java.policy như một biến thể có kiểm soát. Được xem là hoàn tất khi giải thích hoặc khắc phục được lý do Spiffe không khả dụng từ JAR thực thi mà không phụ thuộc vào install().
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
I am trying to plugin the SpiffeProvider using just the java.security properties file, but this is not working for some reason. Can you please help me figure this out? I have to also mention that I don't rely on the SpiffeProvider.install()
The java.security content
# The provider sequence, 11 is accurate
security.provider.11=io.spiffe.provider.SpiffeProvider
# Determines the default key and trust manager factory algorithms for
# the javax.net.ssl package.
#
ssl.KeyManagerFactory.algorithm=Spiffe
ssl.TrustManagerFactory.algorithm=Spiffe
# list of accepted SPIFFE IDs
ssl.spiffe.accept=spiffe://example.org/myservice
Please see this commit on my fork https://github.com/alwaysastudent/java-spiffe-examples/commit/805a56d768489733d643bbcc01ac01fd6f9b4ebf where I am trying to test a spring boot application jar.
The way I am running this example is by
java-spiffe-examples/spring-boot-x509-demo]$ java -Djava.security.debug=properties -Djava.security.policy=java.policy -Djava.security.properties=java.security -jar ./backend/build/libs/backend-0.1.jar
properties: reading security properties file: /Users/alwaysastudent/.sdkman/candidates/java/8.0.272.hs-adpt/jre/lib/security/java.security
properties: reading security properties file: file:/Users/alwaysastudent/dev/temp-projects/fork/java-spiffe-examples/spring-boot-x509-demo/java.security
But I am getting the following error
java.security.KeyStoreException: Spiffe not found
at java.security.KeyStore.getInstance(KeyStore.java:851) ~[na:1.8.0_272]
at org.apache.tomcat.util.net.SSLUtilBase.getStore(SSLUtilBase.java:184) [tomcat-embed-core-9.0.37.jar!/:9.0.37]
at org.apache.tomcat.util.net.SSLHostConfigCertificate.getCertificateKeystore(SSLHostConfigCertificate.java:207) [tomcat-embed-core-9.0.37.jar!/:9.0.37]
at org.apache.tomcat.util.net.SSLUtilBase.getKeyManagers(SSLUtilBase.java:282) [tomcat-embed-core-9.0.37.jar!/:9.0.37]
at org.apache.tomcat.util.net.SSLUtilBase.createSSLContext(SSLUtilBase.java:246) [tomcat-embed-core-9.0.37.jar!/:9.0.37]
at org.apache.tomcat.util.net.AbstractJsseEndpoint.createSSLContext(AbstractJsseEndpoint.java:97) [tomcat-embed-core-9.0.37.jar!/:9.0.37]
at org.apache.tomcat.util.net.AbstractJsseEndpoint.initialiseSsl(AbstractJsseEndpoint.java:71) [tomcat-embed-core-9.0.37.jar!/:9.0.37]
at org.apache.tomcat.util.net.NioEndpoint.bind(NioEndpoint.java:216) [tomcat-embed-core-9.0.37.jar!/:9.0.37]
at org.apache.tomcat.util.net.AbstractEndpoint.bindWithCleanup(AbstractEndpoint.java:1141) [tomcat-embed-core-9.0.37.jar!/:9.0.37]
at org.apache.tomcat.util.net.AbstractEndpoint.start(AbstractEndpoint.java:1227) [tomcat-embed-core-9.0.37.jar!/:9.0.37]
at org.apache.coyote.AbstractProtocol.start(AbstractProtocol.java:592) [tomcat-embed-core-9.0.37.jar!/:9.0.37]
at org.apache.catalina.connector.Connector.startInternal(Connector.java:1064) [tomcat-embed-core-9.0.37.jar!/:9.0.37]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) [tomcat-embed-core-9.0.37.jar!/:9.0.37]
at org.apache.catalina.core.StandardService.addConnector(StandardService.java:227) [tomcat-embed-core-9.0.37.jar!/:9.0.37]
at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.addPreviouslyRemovedConnectors(TomcatWebServer.java:282) [spring-boot-2.3.3.RELEASE.jar!/:2.3.3.RELEASE]
at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.start(TomcatWebServer.java:213) [spring-boot-2.3.3.RELEASE.jar!/:2.3.3.RELEASE]
at org.springframework.boot.web.servlet.context.WebServerStartStopLifecycle.start(WebServerStartStopLifecycle.java:43) [spring-boot-2.3.3.RELEASE.jar!/:2.3.3.RELEASE]
at org.springframework.context.support.DefaultLifecycleProcessor.doStart(DefaultLifecycleProcessor.java:182) [spring-context-5.2.8.RELEASE.jar!/:5.2.8.RELEASE]
at org.springframework.context.support.DefaultLifecycleProcessor.access$200(DefaultLifecycleProcessor.java:53) [spring-context-5.2.8.RELEASE.jar!/:5.2.8.RELEASE]
at org.springframework.context.support.DefaultLifecycleProcessor$LifecycleGroup.start(DefaultLifecycleProcessor.java:360) [spring-context-5.2.8.RELEASE.jar!/:5.2.8.RELEASE]
at org.springframework.context.support.DefaultLifecycleProcessor.startBeans(DefaultLifecycleProcessor.java:158) [spring-context-5.2.8.RELEASE.jar!/:5.2.8.RELEASE]
at org.springframework.context.support.DefaultLifecycleProcessor.onRefresh(DefaultLifecycleProcessor.java:122) [spring-context-5.2.8.RELEASE.jar!/:5.2.8.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:895) [spring-context-5.2.8.RELEASE.jar!/:5.2.8.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:554) [spring-context-5.2.8.RELEASE.jar!/:5.2.8.RELEASE]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:143) [spring-boot-2.3.3.RELEASE.jar!/:2.3.3.RELEASE]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:758) [spring-boot-2.3.3.RELEASE.jar!/:2.3.3.RELEASE]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:750) [spring-boot-2.3.3.RELEASE.jar!/:2.3.3.RELEASE]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397) [spring-boot-2.3.3.RELEASE.jar!/:2.3.3.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:315) [spring-boot-2.3.3.RELEASE.jar!/:2.3.3.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1237) [spring-boot-2.3.3.RELEASE.jar!/:2.3.3.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1226) [spring-boot-2.3.3.RELEASE.jar!/:2.3.3.RELEASE]
at com.example.BackendApp.main(BackendApp.java:14) [classes!/:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_272]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_272]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_272]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_272]
at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:49) [backend-0.1.jar:na]
at org.springframework.boot.loader.Launcher.launch(Launcher.java:109) [backend-0.1.jar:na]
at org.springframework.boot.loader.Launcher.launch(Launcher.java:58) [backend-0.1.jar:na]
at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:88) [backend-0.1.jar:na]
Caused by: java.security.NoSuchAlgorithmException: Spiffe KeyStore not available
at sun.security.jca.GetInstance.getInstance(GetInstance.java:159) ~[na:1.8.0_272]
at java.security.Security.getImpl(Security.java:695) ~[na:1.8.0_272]
at java.security.KeyStore.getInstance(KeyStore.java:848) ~[na:1.8.0_272]
... 39 common frames omitted
I tried with and without the java.policy file and it does not work in both cases. If I run the program from intellij it works, but when I run this as an executable jar it does not. Kindly help understand the problem.
- Ngôn ngữ chính
- Java
- Star
- 47
- Fork
- 28
- Merge trung bình
- 11 ngày 6 giờ
- Pull request đã merge (30 ngày)
- 6
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Không có mẫu pull request
- Không có hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của spiffe/java-spiffe
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
spiffe/java-spiffe#108 · 1 reaction ·
-
Manage Dependencies of Netty and gRPC with their respective BOMsCó thể làm lại được @maxlambrecht đã nhận 1368 ngày trước và không có pull request nào đang mở. Đang mở
spiffe/java-spiffe#106 · 2 reaction · 1 người được giao ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
spiffe/java-spiffe#79 · 2 bình luận ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
spiffe/java-spiffe#76 · 7 bình luận ·
Tất cả issue của spiffe/java-spiffe
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
utopia-rise/godot-jvm#1004 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
spring-projects/spring-grpc#442 ·
-
Expose numberOfPermits in RateLimiterEvent.toString() and the ratelimiterevents actuator DTOĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
resilience4j/resilience4j#2547 ·
Maintainer thường phản hồi trong vòng 9 ngày
-
Clock.MakeDate continues execution and returns a rolled-over instant after dispatching error on invalid dateCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 82/100
mit-cml/appinventor-sources#4155 ·
Maintainer thường phản hồi trong vòng 1 ngày