Should we make SslOptions be more explicit about where it loads certifications?
還沒有人認領這個 Issue。
評估
研究方向
先閱讀第 245 行附近的 SslOptions.java,追蹤目前如何解析憑證路徑。將 issue 中明確的 classpath 和 file URI 情況與現有的 fallback 行為進行比較,接著確認預期的相容性規則,並為已達成共識的解析路徑新增涵蓋範圍。
由索引模型根據 Issue 內容生成。
描述
I'm not sure I like the default fallback behavior here:
Instead I recommend something more like:
static InputStream getResource(
String path)
throws FileNotFoundException, IOException {
URI uri = URI.create(path);
/*
* Explicit
*/
if ("classpath".equals(uri.getScheme())) {
var classpath = uri.getPath();
if (classpath == null) {
throw new FileNotFoundException(path);
}
return getClasspathResource(classpath);
}
if ("file".equals(uri.getScheme())) {
return Files.newInputStream(Path.of(uri));
}
/*
* Implicit
*/
Path filepath = Paths.get(path);
if (Files.exists(filepath)) {
// absolute file:
return Files.newInputStream(filepath);
}
// Maybe do not do this
return getClasspathResource(path);
}
This is where classpath:/// and file:/// can be explicitly used and then if that is not used we do the original behavior with the eventual goal of not doing the classpath unless it has the classpath uri schema.
The reason is assume I package a certification in the classpath. It works normally. Then someone adds a classpath on the filesystem when I go deploy. It now overrides the classpath one.
Now I admit this is unlikely and if this was not certs I could care less but I think we should not go around sniffing for certs. It also seems more inline with how we no longer use the service loader. That is less implicit behavior.
Otherwise I mostly don't care but just think this is the right thing to do.
- 主要語言
- Java
- 星號
- 1.8k
- 分支
- 202
- 平均合併
- 2 天 9 小時
- 30 天內合併 PR
- 6
貢獻指南
這個儲存庫沒有索引到貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
jooby-project/jooby 的其他 Issue
-
難度 5/5 一週以上 新手友好度 20/100
jooby-project/jooby#3996 ·
-
bug web-server
難度 3/5 1-2 天 新手友好度 48/100
jooby-project/jooby#3995 ·
-
難度 4/5 3-5 天 新手友好度 25/100
jooby-project/jooby#3521 · 2 則留言 ·
-
question
難度 4/5 3-5 天 新手友好度 35/100
jooby-project/jooby#1513 · 10 則留言 ·
查看 jooby-project/jooby 的全部 Issue
相似的 Issue
-
Bug Java Platform: Java
難度 2/5 1-3 小時 新手友好度 78/100
getsentry/sentry-java#6138 · 1 則留言 ·
-
bug needs triage p2
難度 2/5 1-3 小時 新手友好度 78/100
GoogleCloudPlatform/DataflowTemplates#4273 · 1 則留言 ·
-
難度 2/5 1-3 小時 新手友好度 78/100
-
難度 2/5 1-3 小時 新手友好度 76/100
-
bug needs triage
難度 2/5 1-3 小時 新手友好度 76/100