Changeset 19650 in josm for trunk/test/unit


Ignore:
Timestamp:
2026-10-21T16:58:33+02:00 (12 days ago)
Author:
gaben
Message:

fix #24962 - use a TLSv1.3 context when installing amended root certificates

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/unit/org/openstreetmap/josm/io/CertificateAmendmentTest.java

    r18037 r19650  
    66import net.trajano.commons.testing.UtilityClassTestUtil;
    77import org.junit.jupiter.api.Test;
     8
     9import javax.net.ssl.SSLContext;
     10import java.io.IOException;
     11import java.security.GeneralSecurityException;
     12import java.util.Arrays;
     13import java.util.List;
     14
     15import static org.junit.jupiter.api.Assertions.assertTrue;
    816
    917/**
    … …  
    2028        UtilityClassTestUtil.assertUtilityClassWellDefined(CertificateAmendment.class);
    2129    }
     30
     31    /**
     32     * Non-regression test for <a href="https://josm.openstreetmap.de/ticket/24962">Bug #24962</a>.
     33     * Adding missing certificates must not restrict HTTPS connections to TLS 1.2.
     34     * @throws IOException if an I/O error occurs
     35     * @throws GeneralSecurityException if a security error occurs
     36     */
     37    @Test
     38    void testTicket24962() throws IOException, GeneralSecurityException {
     39        CertificateAmendment.addMissingCertificates();
     40        List<String> protocols = Arrays.asList(SSLContext.getDefault().getDefaultSSLParameters().getProtocols());
     41        assertTrue(protocols.contains("TLSv1.3"), protocols::toString);
     42    }
    2243}
Note: See TracChangeset for help on using the changeset viewer.