mirror of https://github.com/apache/nifi.git
NIFI-300, NIFI-298: Fixed bugs causing failures when sending to non-https addresses and sending as flowfile
This commit is contained in:
parent
8b3f3c75cd
commit
c8ecdd9ddf
|
@ -319,7 +319,11 @@ public class PostHTTP extends AbstractProcessor {
|
|||
return config;
|
||||
}
|
||||
|
||||
final PoolingHttpClientConnectionManager conMan;
|
||||
final SSLContextService sslContextService = context.getProperty(SSL_CONTEXT_SERVICE).asControllerService(SSLContextService.class);
|
||||
if ( sslContextService == null ) {
|
||||
conMan = new PoolingHttpClientConnectionManager();
|
||||
} else {
|
||||
final SSLContext sslContext;
|
||||
try {
|
||||
sslContext = createSSLContext(sslContextService);
|
||||
|
@ -333,7 +337,9 @@ public class PostHTTP extends AbstractProcessor {
|
|||
final Registry<ConnectionSocketFactory> socketFactoryRegistry = RegistryBuilder.<ConnectionSocketFactory>create()
|
||||
.register("https", sslsf).build();
|
||||
|
||||
final PoolingHttpClientConnectionManager conMan = new PoolingHttpClientConnectionManager(socketFactoryRegistry);
|
||||
conMan = new PoolingHttpClientConnectionManager(socketFactoryRegistry);
|
||||
}
|
||||
|
||||
conMan.setDefaultMaxPerRoute(context.getMaxConcurrentTasks());
|
||||
conMan.setMaxTotal(context.getMaxConcurrentTasks());
|
||||
config = new Config(conMan);
|
||||
|
@ -428,6 +434,10 @@ public class PostHTTP extends AbstractProcessor {
|
|||
public void process(final HttpResponse response, final HttpContext httpContext) throws HttpException, IOException {
|
||||
HttpCoreContext coreContext = HttpCoreContext.adapt(httpContext);
|
||||
ManagedHttpClientConnection conn = coreContext.getConnection(ManagedHttpClientConnection.class);
|
||||
if ( !conn.isOpen() ) {
|
||||
return;
|
||||
}
|
||||
|
||||
SSLSession sslSession = conn.getSSLSession();
|
||||
|
||||
if ( sslSession != null ) {
|
||||
|
|
Loading…
Reference in New Issue