/** * @return {@code true} if the remote instance is configured for secure * site-to-site communications, {@code false} otherwise * @throws IOException if unable to check if secure */ public boolean isSecure() throws IOException { remoteInfoReadLock.lock(); try { final Boolean secure = this.siteToSiteSecure; if (secure != null && this.remoteRefreshTime > System.currentTimeMillis() - REMOTE_REFRESH_MILLIS) { return secure; } } finally { remoteInfoReadLock.unlock(); } final ControllerDTO controller = refreshRemoteInfo(); final Boolean isSecure = controller.isSiteToSiteSecure(); if (isSecure == null) { throw new IOException("Remote NiFi instance " + clusterUrls + " is not currently configured to accept site-to-site connections"); } return isSecure; }
this.siteToSitePort = controller.getRemoteSiteListeningPort(); this.siteToSiteHttpPort = controller.getRemoteSiteHttpListeningPort(); this.siteToSiteSecure = controller.isSiteToSiteSecure(); this.activeClusterUrl = connectedClusterUrl;
listeningPort = dto.getRemoteSiteListeningPort(); listeningHttpPort = dto.getRemoteSiteHttpListeningPort(); destinationSecure = dto.isSiteToSiteSecure(); } finally { writeLock.unlock();
if (modificationNeededRaw || modificationNeededHttp) { final PeerDescription source = getSourcePeerDescription(req); final Boolean isSiteToSiteSecure = controller.isSiteToSiteSecure(); final String siteToSiteHostname = getSiteToSiteHostname(req); final Map<String, String> httpHeaders = getHttpHeaders(req); SiteToSiteTransportProtocol.HTTP, PeerDescriptionModifier.RequestType.SiteToSiteDetail, new HashMap<>(httpHeaders)); controller.setRemoteSiteHttpListeningPort(modifiedHttpTarget.getPort()); if (!controller.isSiteToSiteSecure() && modifiedHttpTarget.isSecure()) {
this.destinationSecure = dto.isSiteToSiteSecure();