@Test
public void testValidateRequestRegularRequestPort() {

    
    ChangeLogStore structStore = new ZMSFileChangeLogStore("/tmp/zts_server_unit_tests/zts_root",
            privateKey, "0");
    DataStore store = new DataStore(structStore, null);
    
    ZTSImpl ztsImpl = new ZTSImpl(mockCloudStore, store);
    ztsImpl.secureRequestsOnly = true;
    ztsImpl.statusPort = 8443;
    
    HttpServletRequest request = Mockito.mock(HttpServletRequest.class);
    Mockito.when(request.isSecure()).thenReturn(true);
    Mockito.when(request.getLocalPort()).thenReturn(8443);
    
    // status requests are allowed on port 8443
    
    ztsImpl.validateRequest(request, "test", "principal-domain", true);
    // non-status requests are not allowed on port 8443
    
    try {
        ztsImpl.validateRequest(request, "principal-domain", "test");
        fail();
    } catch (ResourceException ignored) {
    }
    
    try {
        ztsImpl.validateRequest(request, "principal-domain", "test", false);
        fail();
    } catch (ResourceException ignored) {
    }
}