Skip to content

Commit

Permalink
Add hints on SSL certificates
Browse files Browse the repository at this point in the history
  • Loading branch information
koppor committed Sep 29, 2024
1 parent 85b382e commit 300b7b3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/main/java/org/jabref/logic/net/URLDownload.java
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ public URLDownload(URL source) {
try {
sslContext = SSLContext.getInstance("TLSv1.2");
sslContext.init(null, null, new SecureRandom());
// Note: SSL certificates are installed at {@link TrustStoreManager#configureTrustStore(Path)}
} catch (NoSuchAlgorithmException | KeyManagementException e) {
LOGGER.error("Could not initialize SSL context", e);
sslContext = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
* @implNote SSL certificates are installed at {@link TrustStoreManager#configureTrustStore(Path)}
*/
public class TrustStoreManager {

private static final Logger LOGGER = LoggerFactory.getLogger(TrustStoreManager.class);
Expand Down Expand Up @@ -163,7 +166,9 @@ public static void createTruststoreFileIfNotExist(Path storePath) {
}
}

// based on https://stackoverflow.com/a/62586564/3450689
/**
* @implNote based on https://stackoverflow.com/a/62586564/3450689
*/
private static void configureTrustStore(Path myStorePath) throws NoSuchAlgorithmException, KeyManagementException, KeyStoreException,
CertificateException, IOException {
X509TrustManager jreTrustManager = getJreTrustManager();
Expand Down

0 comments on commit 300b7b3

Please sign in to comment.