Class TlsDirectives
- java.lang.Object
-
- akka.http.javadsl.server.directives.BasicDirectives
-
- akka.http.javadsl.server.directives.CacheConditionDirectives
-
- akka.http.javadsl.server.directives.CodingDirectives
-
- akka.http.javadsl.server.directives.CookieDirectives
-
- akka.http.javadsl.server.directives.DebuggingDirectives
-
- akka.http.javadsl.server.directives.ExecutionDirectives
-
- akka.http.javadsl.server.directives.FileAndResourceDirectives
-
- akka.http.javadsl.server.directives.FileUploadDirectives
-
- akka.http.javadsl.server.directives.FormFieldDirectives
-
- akka.http.javadsl.server.directives.FutureDirectives
-
- akka.http.javadsl.server.directives.HeaderDirectives
-
- akka.http.javadsl.server.directives.AttributeDirectives
-
- akka.http.javadsl.server.directives.HostDirectives
-
- akka.http.javadsl.server.directives.MarshallingDirectives
-
- akka.http.javadsl.server.directives.MethodDirectives
-
- akka.http.javadsl.server.directives.MiscDirectives
-
- akka.http.javadsl.server.directives.ParameterDirectives
-
- akka.http.javadsl.server.directives.PathDirectives
-
- Direct Known Subclasses:
AllDirectives
public abstract class TlsDirectives extends CorsDirectives
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class akka.http.javadsl.server.directives.SecurityDirectives
SecurityDirectives.ProvidedCredentials, SecurityDirectives.ProvidedCredentials$
-
-
Constructor Summary
Constructors Constructor Description TlsDirectives()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Route
extractClientCertificate(java.util.function.Function<java.security.cert.X509Certificate,Route> inner)
Extract the client certificate, or reject the request with aTlsClientUnverifiedRejection
.Route
extractSslSession(java.util.function.Function<javax.net.ssl.SSLSession,Route> inner)
Extract the current SSLSession.Route
requireClientCertificateIdentity(java.lang.String cnRegex, java.util.function.Supplier<Route> inner)
Require the client to be authenticated, if not reject the request with aTlsClientUnverifiedRejection
, also require the one of the client certificateip
ordns
SANs (Subject Alternative Name) or if non exists, the CN (Common Name) to match the given regular expression, if not the request is rejected with aTlsClientIdentityRejection
-
Methods inherited from class akka.http.javadsl.server.directives.CorsDirectives
cors, cors
-
Methods inherited from class akka.http.javadsl.server.directives.FramedEntityStreamingDirectives
attribute, authenticateBasic, authenticateBasicAsync, authenticateBasicAsyncOptional, authenticateBasicOptional, authenticateBasicPF, authenticateBasicPFAsync, authenticateOAuth2, authenticateOAuth2Async, authenticateOAuth2AsyncOptional, authenticateOAuth2Optional, authenticateOrRejectWithChallenge, authenticateOrRejectWithChallenge, authorize, authorizeAsync, authorizeAsyncWithRequestContext, authorizeWithRequestContext, cancelRejection, cancelRejections, cancelRejections, checkSameOrigin, complete, complete, complete, complete, complete, complete, complete, complete, complete, complete, complete, complete, complete, complete, complete, complete, completeOK, completeOKWithFuture, completeOKWithFuture, completeOKWithFuture, completeOKWithFutureString, completeOKWithFutureString, completeOKWithSource, completeOrRecoverWith, completeWith, completeWithFuture, completeWithFuture, completeWithFuture, completeWithFutureResponse, completeWithFutureStatus, completeWithFutureStatus, completeWithSource, concat, concat, conditional, conditional, conditional, conditional, cookie, decodeRequest, decodeRequestWith, decodeRequestWith, defaultContentTypeResolver, defaultDirectoryRenderer, delete, deleteCookie, deleteCookie, deleteCookie, deleteCookie, deleteCookie, encodeResponse, encodeResponseWith, entity, entityAsSourceOf, extract, extractActorSystem, extractClientIP, extractCredentials, extractDataBytes, extractEntity, extractExecutionContext, extractHost, extractLog, extractMatchedPath, extractMaterializer, extractMethod, extractOfferedWsProtocols, extractParserSettings, extractRequest, extractRequestContext, extractRequestEntity, extractRequestTimeout, extractScheme, extractSettings, extractStrictEntity, extractStrictEntity, extractUnmatchedPath, extractUpgradeToWebSocket, extractUri, extractWebSocketUpgrade, failWith, fileUpload, fileUploadAll, formField, formField, formFieldList, formFieldList, formFieldList, formFieldMap, formFieldMultiMap, formFieldOptional, formFieldOptional, get, getFromBrowseableDirectories, getFromBrowseableDirectories, getFromBrowseableDirectories, getFromBrowseableDirectories, getFromBrowseableDirectories, getFromBrowseableDirectory, getFromBrowseableDirectory, getFromBrowseableDirectory, getFromBrowseableDirectory, getFromDirectory, getFromDirectory, getFromFile, getFromFile, getFromFile, getFromFile, getFromFile, getFromResource, getFromResource, getFromResource, getFromResource, getFromResourceDirectory, getFromResourceDirectory, getFromResourceDirectory, getFromResourceDirectory, handle, handleExceptions, handleRejections, handleSync, handleWebSocketMessages, handleWebSocketMessagesForOptionalProtocol, handleWebSocketMessagesForProtocol, handleWith, head, headerValue, headerValueByName, headerValueByType, headerValuePF, host, host, host, host, ignoreTrailingSlash, listDirectoryContents, listDirectoryContents, listDirectoryContents, listDirectoryContents, logRequest, logRequest, logRequest, logRequestResult, logRequestResultOptional, logResult, logResult, logResult, mapInnerRoute, mapRejections, mapRequest, mapRequestContext, mapResponse, mapResponseEntity, mapResponseHeaders, mapRouteResult, mapRouteResultFuture, mapRouteResultPF, mapRouteResultWith, mapRouteResultWithPF, mapSettings, mapUnmatchedPath, method, onComplete, onComplete, onCompleteWithBreaker, onSuccess, onSuccess, optionalAttribute, optionalCookie, optionalHeaderValue, optionalHeaderValueByName, optionalHeaderValueByType, optionalHeaderValuePF, options, overrideMethodWithParameter, parameter, parameter, parameterList, parameterList, parameterList, parameterMap, parameterMultiMap, parameterOptional, parameterOptional, parameterOrDefault, parameterRequiredValue, pass, patch, path, path, path, path, path, path, pathEnd, pathEndOrSingleSlash, pathPrefix, pathPrefix, pathPrefix, pathPrefix, pathPrefix, pathPrefix, pathPrefixTest, pathPrefixTest, pathPrefixTest, pathPrefixTest, pathSingleSlash, pathSuffix, pathSuffix, pathSuffix, pathSuffix, pathSuffixTest, pathSuffixTest, pathSuffixTest, pathSuffixTest, post, provide, put, rawPathPrefix, rawPathPrefix, rawPathPrefix, rawPathPrefix, rawPathPrefixTest, rawPathPrefixTest, rawPathPrefixTest, rawPathPrefixTest, recoverRejections, recoverRejectionsWith, redirect, redirectToNoTrailingSlashIfPresent, redirectToTrailingSlashIfMissing, reject, reject, reject, rejectEmptyResponse, request, requestEncodedWith, requestEntityEmpty, requestEntityPresent, respondWithDefaultHeader, respondWithDefaultHeaders, respondWithHeader, respondWithHeaders, responseEncodingAccepted, route, route, scheme, selectPreferredLanguage, setCookie, setCookie, storeUploadedFile, storeUploadedFiles, toStrictEntity, toStrictEntity, validate, withExecutionContext, withLog, withMaterializer, withoutRequestTimeout, withoutSizeLimit, withPrecompressedMediaTypeSupport, withRangeSupport, withRequestTimeout, withRequestTimeout, withRequestTimeoutResponse, withSettings, withSizeLimit
-
Methods inherited from class akka.http.javadsl.server.directives.TimeoutDirectives
extractRequestTimeout, withoutRequestTimeout, withRequestTimeout, withRequestTimeout, withRequestTimeoutResponse
-
Methods inherited from class akka.http.javadsl.server.directives.WebSocketDirectives
extractOfferedWsProtocols, extractUpgradeToWebSocket, extractWebSocketUpgrade, handleWebSocketMessages, handleWebSocketMessagesForOptionalProtocol, handleWebSocketMessagesForProtocol
-
Methods inherited from class akka.http.javadsl.server.directives.SecurityDirectives
authenticateBasic, authenticateBasicAsync, authenticateBasicAsyncOptional, authenticateBasicOptional, authenticateBasicPF, authenticateBasicPFAsync, authenticateOAuth2, authenticateOAuth2Async, authenticateOAuth2AsyncOptional, authenticateOAuth2Optional, authenticateOrRejectWithChallenge, authenticateOrRejectWithChallenge, authorize, authorizeAsync, authorizeAsyncWithRequestContext, authorizeWithRequestContext, extractCredentials
-
Methods inherited from class akka.http.javadsl.server.directives.SchemeDirectives
extractScheme, scheme
-
Methods inherited from class akka.http.javadsl.server.directives.RouteDirectives
complete, complete, complete, complete, complete, complete, complete, complete, complete, complete, complete, complete, complete, complete, complete, complete, completeOK, completeOKWithFuture, completeOKWithFuture, completeOKWithFuture, completeOKWithFutureString, completeOKWithFutureString, completeWithFuture, completeWithFuture, completeWithFuture, completeWithFutureResponse, completeWithFutureStatus, completeWithFutureStatus, concat, concat, failWith, handle, handleSync, redirect, reject, reject, reject, route, route
-
Methods inherited from class akka.http.javadsl.server.directives.RespondWithDirectives
respondWithDefaultHeader, respondWithDefaultHeaders, respondWithHeader, respondWithHeaders
-
Methods inherited from class akka.http.javadsl.server.directives.RangeDirectives
withRangeSupport
-
Methods inherited from class akka.http.javadsl.server.directives.PathDirectives
ignoreTrailingSlash, path, path, path, path, path, path, pathEnd, pathEndOrSingleSlash, pathPrefix, pathPrefix, pathPrefix, pathPrefix, pathPrefix, pathPrefix, pathPrefixTest, pathPrefixTest, pathPrefixTest, pathPrefixTest, pathSingleSlash, pathSuffix, pathSuffix, pathSuffix, pathSuffix, pathSuffixTest, pathSuffixTest, pathSuffixTest, pathSuffixTest, rawPathPrefix, rawPathPrefix, rawPathPrefix, rawPathPrefix, rawPathPrefixTest, rawPathPrefixTest, rawPathPrefixTest, rawPathPrefixTest, redirectToNoTrailingSlashIfPresent, redirectToTrailingSlashIfMissing
-
Methods inherited from class akka.http.javadsl.server.directives.ParameterDirectives
parameter, parameter, parameterList, parameterList, parameterList, parameterMap, parameterMultiMap, parameterOptional, parameterOptional, parameterOrDefault, parameterRequiredValue
-
Methods inherited from class akka.http.javadsl.server.directives.MiscDirectives
extractClientIP, rejectEmptyResponse, requestEntityEmpty, requestEntityPresent, selectPreferredLanguage, validate, withoutSizeLimit, withSizeLimit
-
Methods inherited from class akka.http.javadsl.server.directives.MethodDirectives
delete, extractMethod, get, head, method, options, overrideMethodWithParameter, patch, post, put
-
Methods inherited from class akka.http.javadsl.server.directives.MarshallingDirectives
completeWith, entity, handleWith, request
-
Methods inherited from class akka.http.javadsl.server.directives.HostDirectives
extractHost, host, host, host, host
-
Methods inherited from class akka.http.javadsl.server.directives.AttributeDirectives
attribute, optionalAttribute
-
Methods inherited from class akka.http.javadsl.server.directives.HeaderDirectives
checkSameOrigin, headerValue, headerValueByName, headerValueByType, headerValuePF, optionalHeaderValue, optionalHeaderValueByName, optionalHeaderValueByType, optionalHeaderValuePF
-
Methods inherited from class akka.http.javadsl.server.directives.FutureDirectives
completeOrRecoverWith, onComplete, onComplete, onCompleteWithBreaker, onSuccess, onSuccess
-
Methods inherited from class akka.http.javadsl.server.directives.FormFieldDirectives
formField, formField, formFieldList, formFieldList, formFieldList, formFieldMap, formFieldMultiMap, formFieldOptional, formFieldOptional
-
Methods inherited from class akka.http.javadsl.server.directives.FileUploadDirectives
fileUpload, fileUploadAll, storeUploadedFile, storeUploadedFiles
-
Methods inherited from class akka.http.javadsl.server.directives.FileAndResourceDirectives
defaultContentTypeResolver, defaultDirectoryRenderer, getFromBrowseableDirectories, getFromBrowseableDirectories, getFromBrowseableDirectories, getFromBrowseableDirectories, getFromBrowseableDirectories, getFromBrowseableDirectory, getFromBrowseableDirectory, getFromBrowseableDirectory, getFromBrowseableDirectory, getFromDirectory, getFromDirectory, getFromFile, getFromFile, getFromFile, getFromFile, getFromFile, getFromResource, getFromResource, getFromResource, getFromResource, getFromResourceDirectory, getFromResourceDirectory, getFromResourceDirectory, getFromResourceDirectory, listDirectoryContents, listDirectoryContents, listDirectoryContents, listDirectoryContents
-
Methods inherited from class akka.http.javadsl.server.directives.ExecutionDirectives
handleExceptions, handleRejections
-
Methods inherited from class akka.http.javadsl.server.directives.DebuggingDirectives
logRequest, logRequest, logRequest, logRequestResult, logRequestResultOptional, logResult, logResult, logResult
-
Methods inherited from class akka.http.javadsl.server.directives.CookieDirectives
cookie, deleteCookie, deleteCookie, deleteCookie, deleteCookie, deleteCookie, optionalCookie, setCookie, setCookie
-
Methods inherited from class akka.http.javadsl.server.directives.CodingDirectives
decodeRequest, decodeRequestWith, decodeRequestWith, encodeResponse, encodeResponseWith, requestEncodedWith, responseEncodingAccepted, withPrecompressedMediaTypeSupport
-
Methods inherited from class akka.http.javadsl.server.directives.CacheConditionDirectives
conditional, conditional, conditional, conditional
-
Methods inherited from class akka.http.javadsl.server.directives.BasicDirectives
cancelRejection, cancelRejections, cancelRejections, extract, extractActorSystem, extractDataBytes, extractEntity, extractExecutionContext, extractLog, extractMatchedPath, extractMaterializer, extractParserSettings, extractRequest, extractRequestContext, extractRequestEntity, extractSettings, extractStrictEntity, extractStrictEntity, extractUnmatchedPath, extractUri, mapInnerRoute, mapRejections, mapRequest, mapRequestContext, mapResponse, mapResponseEntity, mapResponseHeaders, mapRouteResult, mapRouteResultFuture, mapRouteResultPF, mapRouteResultWith, mapRouteResultWithPF, mapSettings, mapUnmatchedPath, pass, provide, recoverRejections, recoverRejectionsWith, toStrictEntity, toStrictEntity, withExecutionContext, withLog, withMaterializer, withSettings
-
-
-
-
Method Detail
-
extractClientCertificate
public Route extractClientCertificate(java.util.function.Function<java.security.cert.X509Certificate,Route> inner)
Extract the client certificate, or reject the request with aTlsClientUnverifiedRejection
.Using this directives requires tls-session info parsing to be enabled:
akka.http.server.parsing.tls-session-info-header = on
The
SSLEngine
for the server needs to be set up withsetWantClientAuth(true)
orsetNeedClientAuth(true)
or else every request will be failed.- Parameters:
inner
- (undocumented)- Returns:
- (undocumented)
-
extractSslSession
public Route extractSslSession(java.util.function.Function<javax.net.ssl.SSLSession,Route> inner)
Extract the current SSLSession.Note: Using this directives requires tls-session info parsing to be enabled:
akka.http.server.parsing.tls-session-info-header = on
- Parameters:
inner
- (undocumented)- Returns:
- (undocumented)
-
requireClientCertificateIdentity
public Route requireClientCertificateIdentity(java.lang.String cnRegex, java.util.function.Supplier<Route> inner)
Require the client to be authenticated, if not reject the request with aTlsClientUnverifiedRejection
, also require the one of the client certificateip
ordns
SANs (Subject Alternative Name) or if non exists, the CN (Common Name) to match the given regular expression, if not the request is rejected with aTlsClientIdentityRejection
Using this directives requires tls-session info parsing to be enabled:
akka.http.server.parsing.tls-session-info-header = on
The
SSLEngine
for the server needs to be set up withsetWantClientAuth(true)
orsetNeedClientAuth(true)
or else every request will be failed.- Parameters:
cnRegex
- (undocumented)inner
- (undocumented)- Returns:
- (undocumented)
-
-