String keystoreType = config.keystoreType().get(); String keystorePath = config.keystorePath().get(); String keystorePassword = config.keystorePassword().get(); ssl.setKeyStoreType( keystoreType ); if( "PKCS12".equals( keystoreType ) ) String certAlias = config.certAlias().get(); if( certAlias != null ) String truststoreType = config.truststoreType().get(); String truststorePath = config.truststorePath().get(); String truststorePassword = config.truststorePassword().get(); if( truststoreType != null && truststorePath != null ) Boolean want = config.wantClientAuth().get(); if( want != null ) Boolean need = config.needClientAuth().get(); if( need != null ) String secureRandomAlgo = config.secureRandomAlgorithm().get(); if( secureRandomAlgo != null ) String cipherExcludesConfigString = config.excludeCipherSuites().get(); if( cipherExcludesConfigString != null ) String cipherIncludesConfigString = config.includeCipherSuites().get(); if( cipherIncludesConfigString != null )
@Override public void assemble( ModuleAssembly module ) throws AssemblyException { ModuleAssembly configModule = module; new EntityTestAssembler().assemble( configModule ); new SecureJettyServiceAssembler().withConfig( configModule, Visibility.layer ).assemble( module ); // START SNIPPET: config SecureJettyConfiguration config = configModule.forMixin( SecureJettyConfiguration.class ).declareDefaults(); config.hostName().set( "127.0.0.1" ); config.port().set( httpsPort ); config.keystorePath().set( getKeyStoreFile( SERVER_KEYSTORE_FILENAME ).getAbsolutePath() ); config.keystoreType().set( "JCEKS" ); config.keystorePassword().set( KS_PASSWORD ); config.truststorePath().set( getKeyStoreFile( TRUSTSTORE_FILENAME ).getAbsolutePath() ); config.truststoreType().set( "JCEKS" ); config.truststorePassword().set( KS_PASSWORD ); config.wantClientAuth().set( Boolean.TRUE ); // END SNIPPET: config addServlets( serve( "/hello" ).with( HelloWorldServletService.class ) ).to( module ); }
@Override public void assemble( ModuleAssembly module ) throws AssemblyException { ModuleAssembly configModule = module; new EntityTestAssembler().assemble( configModule ); // START SNIPPET: assemblyssl new SecureJettyServiceAssembler().withConfig( configModule, Visibility.layer ).assemble( module ); // END SNIPPET: assemblyssl // START SNIPPET: configssl SecureJettyConfiguration config = configModule.forMixin( SecureJettyConfiguration.class ).declareDefaults(); config.hostName().set( "127.0.0.1" ); config.port().set( httpsPort ); config.keystorePath().set( getKeyStoreFile( SERVER_KEYSTORE_FILENAME ).getAbsolutePath() ); config.keystoreType().set( "JCEKS" ); config.keystorePassword().set( KS_PASSWORD ); // END SNIPPET: configssl // START SNIPPET: assemblyssl addServlets( serve( "/hello" ).with( HelloWorldServletService.class ) ).to( module ); addFilters( filter( "/*" ).through( UnitOfWorkFilterService.class ).on( REQUEST ) ).to( module ); // END SNIPPET: assemblyssl }
String keystoreType = config.keystoreType().get(); String keystorePath = config.keystorePath().get(); String keystorePassword = config.keystorePassword().get(); ssl.setKeyStoreType( keystoreType ); if( "PKCS12".equals( keystoreType ) ) String certAlias = config.certAlias().get(); if( certAlias != null ) String truststoreType = config.truststoreType().get(); String truststorePath = config.truststorePath().get(); String truststorePassword = config.truststorePassword().get(); if( truststoreType != null && truststorePath != null ) Boolean want = config.wantClientAuth().get(); if( want != null ) Boolean need = config.needClientAuth().get(); if( need != null ) String secureRandomAlgo = config.secureRandomAlgorithm().get(); if( secureRandomAlgo != null ) String cipherExcludesConfigString = config.excludeCipherSuites().get(); if( cipherExcludesConfigString != null ) String cipherIncludesConfigString = config.includeCipherSuites().get(); if( cipherIncludesConfigString != null )