ttomcat-1778514358873.zip-extract/apache-tomcat-11.0.18-src/test/org/apache/tomcat/util/net/ocsp/TestOcspTimeout.java

Path
ttomcat-1778514358873.zip-extract/apache-tomcat-11.0.18-src/test/org/apache/tomcat/util/net/ocsp/TestOcspTimeout.java
Status
scanned
Type
file
Name
TestOcspTimeout.java
Extension
.java
Programming language
Java
Mime type
text/plain
File type
ASCII text, with CRLF line terminators
Tag

      
    
Rootfs path

      
    
Size
2609 (2.5 KB)
MD5
1fee6aa19c9e764f5da78eb477f59c1b
SHA1
3d058894d9a6beff8c952cd35591aad2806466a4
SHA256
2fc626d82d45a4c58d6cb2cab01ddb896cd70edfe10c367f25505a9ef6cafe99
SHA512

      
    
SHA1_git
8dad3a90054f8e62376383d0ee242ad5e9fd3c4c
Is binary

      
    
Is text
True
Is archive

      
    
Is media

      
    
Is legal

      
    
Is manifest

      
    
Is readme

      
    
Is top level

      
    
Is key file

      
    
TestOcspTimeout.java | 2.5 KB |

/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.tomcat.util.net.ocsp; import java.net.SocketException; import java.net.SocketTimeoutException; import javax.net.ssl.SSLHandshakeException; import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; /* * The timeout for reading an OCSP response is 15s by default for both JSSE and OpenSSL. */ @RunWith(Parameterized.class) public class TestOcspTimeout extends OcspBaseTest { private static TesterOcspResponderNoResponse ocspResponder; @BeforeClass public static void startOcspResponder() { /* * Use shorter timeout to speed up test. * * Note: OpenSSL timeout set later as it requires access to SSLHostConfig. */ System.setProperty("com.sun.security.ocsp.readtimeout", "1000ms"); ocspResponder = new TesterOcspResponderNoResponse(); ocspResponder.start(); } @AfterClass public static void stopOcspResponder() { ocspResponder.stop(); ocspResponder = null; } @Test public void testTimeoutWithSoftFail() throws Exception { doTest(false, false, ClientCertificateVerification.ENABLED, false, Boolean.TRUE); } @Test(expected = SSLHandshakeException.class) public void testTimeoutWithoutSoftFail() throws Exception { try { doTest(false, false, ClientCertificateVerification.ENABLED, false, Boolean.FALSE); } catch (SocketTimeoutException | SocketException e) { // May throw a SocketTimeoutException or SocketException rather than a SSLHandshakeException throw new SSLHandshakeException(e.getMessage()); } } }
Detected license expression
apache-2.0
Detected license expression (SPDX)
Apache-2.0
Percentage of license text
42.5
Copyrights

      
    
Holders

      
    
Authors

      
    
License detections License expression License expression SPDX
apache_2_0-4bde3f57-78aa-4201-96bf-531cba09e7de apache-2.0 Apache-2.0
URL Start line End line
http://www.apache.org/licenses/LICENSE-2.0 9 9