本文整理了Java中ch.cyberduck.core.Protocol.isSecure()
方法的一些代码示例,展示了Protocol.isSecure()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Protocol.isSecure()
方法的具体详情如下:
包路径:ch.cyberduck.core.Protocol
类名称:Protocol
方法名:isSecure
暂无
代码示例来源:origin: iterate-ch/cyberduck
@Override
protected void sslNegotiation() throws IOException {
if(protocol.isSecure()) {
final SSLSocket socket = (SSLSocket) sslSocketFactory.createSocket(_socket_,
_socket_.getInetAddress().getHostAddress(), _socket_.getPort(), false);
socket.setEnableSessionCreation(true);
socket.setUseClientMode(true);
socket.startHandshake();
_socket_ = socket;
_controlInput_ = new BufferedReader(new InputStreamReader(
socket.getInputStream(), getControlEncoding()));
_controlOutput_ = new BufferedWriter(new OutputStreamWriter(
socket.getOutputStream(), getControlEncoding()));
}
}
代码示例来源:origin: iterate-ch/cyberduck
@Override
public void interrupt() throws BackgroundException {
if(host.getProtocol().isSecure()) {
// The client and the server must share knowledge that the connection is ending in order to avoid a truncation attack.
// Either party may initiate the exchange of closing messages.
log.warn(String.format("Skip disconnect for %s connection to workaround hang in closing socket", host.getProtocol()));
super.disconnect();
}
else {
super.interrupt();
}
}
代码示例来源:origin: iterate-ch/cyberduck
@Override
public void execPBSZ(final long pbsz) throws IOException {
if(protocol.isSecure()) {
if(FTPReply.COMMAND_OK != this.sendCommand("PBSZ", String.valueOf(pbsz))) {
throw new FTPException(this.getReplyCode(), this.getReplyString());
}
}
}
代码示例来源:origin: iterate-ch/cyberduck
@Override
public void execPROT(final String prot) throws IOException {
if(protocol.isSecure()) {
if(FTPReply.COMMAND_OK != this.sendCommand("PROT", prot)) {
throw new FTPException(this.getReplyCode(), this.getReplyString());
}
if("P".equals(prot)) {
// Private
this.setSocketFactory(sslSocketFactory);
}
}
}
代码示例来源:origin: iterate-ch/cyberduck
/**
* Configure the HTTP Session to proxy through UDT
*/
public HttpSession<?> configure(final HttpSession<?> session) throws BackgroundException {
// Add X-Qloudsonic-* headers
final List<Header> headers = provider.headers();
if(log.isInfoEnabled()) {
log.info(String.format("Obtained headers %s fro provider %s", headers, provider));
}
// Run through secured proxy only if direct connection has transport security
final Host proxy = provider.find(location, session.getHost().getProtocol().isSecure());
final HttpConnectionPoolBuilder builder
= new UDTHttpConnectionPoolBuilder(session.getHost(), proxy, headers, trust, key, callback);
// Inject connection builder into session
session.setBuilder(builder);
return session;
}
代码示例来源:origin: iterate-ch/cyberduck
@Override
protected void execAUTH() throws IOException {
if(protocol.isSecure()) {
if(FTPReply.SECURITY_DATA_EXCHANGE_COMPLETE != this.sendCommand("AUTH", this.getAuthValue())) {
throw new FTPException(this.getReplyCode(), this.getReplyString());
}
}
}
代码示例来源:origin: iterate-ch/cyberduck
public boolean alert(final ConnectionCallback callback) throws BackgroundException {
if(host.getProtocol().isSecure()) {
return false;
}
if(host.getCredentials().isAnonymousLogin()) {
return false;
}
final Preferences preferences = PreferencesFactory.get();
if(preferences.getBoolean(String.format("connection.unsecure.%s", host.getHostname()))) {
return false;
}
return preferences.getBoolean(
String.format("connection.unsecure.warning.%s", host.getProtocol().getScheme()));
}
代码示例来源:origin: iterate-ch/cyberduck
configuration.setProperty("s3service.https-only", String.valueOf(host.getProtocol().isSecure()));
if(host.getProtocol().isSecure()) {
configuration.setProperty("s3service.s3-endpoint-https-port", String.valueOf(host.getPort()));
代码示例来源:origin: iterate-ch/cyberduck
try {
if(client.login(host.getCredentials().getUsername(), host.getCredentials().getPassword())) {
if(host.getProtocol().isSecure()) {
client.execPBSZ(0);
代码示例来源:origin: iterate-ch/cyberduck
@Override
public Registry<ConnectionSocketFactory> createRegistry() {
final RegistryBuilder<ConnectionSocketFactory> registry = RegistryBuilder.create();
if(proxy.getProtocol().isSecure()) {
registry.register(proxy.getProtocol().getScheme().toString(), new SSLConnectionSocketFactory(
new CustomTrustSSLProtocolSocketFactory(trust, key),
内容来源于网络,如有侵权,请联系作者删除!