Examples of TransportException


Examples of net.schmizz.sshj.transport.TransportException

    @Override
    public boolean next(Message msg, SSHPacket packet)
            throws GeneralSecurityException, TransportException {
        if (msg != Message.KEXDH_31)
            throw new TransportException(DisconnectReason.KEY_EXCHANGE_FAILED, "Unexpected packet: " + msg);

        log.info("Received SSH_MSG_KEXDH_REPLY");
        final byte[] K_S;
        final BigInteger f;
        final byte[] sig; // signature sent by server
        try {
            K_S = packet.readBytes();
            f = packet.readMPInt();
            sig = packet.readBytes();
            hostKey = new Buffer.PlainBuffer(K_S).readPublicKey();
        } catch (Buffer.BufferException be) {
            throw new TransportException(be);
        }

        dh.computeK(f);

        final Buffer.PlainBuffer buf = new Buffer.PlainBuffer()
                .putString(V_C)
                .putString(V_S)
                .putString(I_C)
                .putString(I_S)
                .putString(K_S)
                .putMPInt(dh.getE())
                .putMPInt(f)
                .putMPInt(dh.getK());
        sha1.update(buf.array(), buf.rpos(), buf.available());
        H = sha1.digest();

        Signature signature = Factory.Named.Util.create(trans.getConfig().getSignatureFactories(),
                                                        KeyType.fromKey(hostKey).toString());
        signature.init(hostKey, null);
        signature.update(H, 0, H.length);
        if (!signature.verify(sig))
            throw new TransportException(DisconnectReason.KEY_EXCHANGE_FAILED,
                                         "KeyExchange signature verification failed");
        return true;
    }
View Full Code Here

Examples of org.apache.geronimo.remoting.transport.TransportException

                inflator = new Inflater(true);
                deflater = new Deflater(compression, true);
            }
           
        } catch (Exception e) {
            throw new TransportException("Connection handshake failed: " + e);
        }

        worker = new Thread(this, "Channel -> " + remoteURI);
        worker.setDaemon(true);
        worker.start();
View Full Code Here

Examples of org.apache.juddi.v3.client.transport.TransportException

      try {
        String clazz = getProxyTransport();
        Class<?> transportClass = Loader.loadClass(clazz);
        transport = (Transport) transportClass.getConstructor(String.class,String.class).newInstance(managerName,name);
      } catch (Exception e) {
        throw new TransportException(e.getMessage(),e);
      }
    }
    return transport;
  }
View Full Code Here

Examples of org.apache.qpid.proton.engine.TransportException

        }
        if(length == 0)
        {
            if(_connectionEndpoint == null || _connectionEndpoint.getRemoteState() != EndpointState.CLOSED)
            {
                throw new TransportException("Unexpected EOS: connection aborted");
            }
        }
        try
        {
            return  _inputProcessor.input(bytes, offset, length);
View Full Code Here

Examples of org.apache.qpid.proton.engine.TransportException

        _size = size;

        _localError = frameParsingError;
        if(_state == State.ERROR )
        {
            throw new TransportException(frameParsingError.getDescription());
        }
        return _state == State.ERROR ? -1 : length - in.remaining();
    }
View Full Code Here

Examples of org.apache.qpid.transport.TransportException

        {
            out = socket.getOutputStream();
        }
        catch (IOException e)
        {
            throw new TransportException("Error getting output stream for socket", e);
        }

        try
        {
            //Create but deliberately don't start the thread.
View Full Code Here

Examples of org.apache.qpid.transport.TransportException

            _socket.connect(new InetSocketAddress(address, settings.getPort()), settings.getConnectTimeout());
        }
        catch (SocketException e)
        {
            throw new TransportException("Error connecting to broker", e);
        }
        catch (IOException e)
        {
            throw new TransportException("Error connecting to broker", e);
        }

        try
        {
            IdleTimeoutTicker ticker = new IdleTimeoutTicker(transportActivity, TIMEOUT);
            _connection = new IoNetworkConnection(_socket, delegate, sendBufferSize, receiveBufferSize, TIMEOUT, ticker);
            ticker.setConnection(_connection);
            _connection.start();
        }
        catch(Exception e)
        {
            try
            {
                _socket.close();
            }
            catch(IOException ioe)
            {
                //ignored, throw based on original exception
            }

            throw new TransportException("Error creating network connection", e);
        }

        return _connection;
    }
View Full Code Here

Examples of org.apache.qpid.transport.TransportException

            _acceptor.setDaemon(false);
            _acceptor.start();
        }
        catch (IOException e)
        {
            throw new TransportException("Unable to start server socket", e);
        }
    }
View Full Code Here

Examples of org.apache.qpid.transport.TransportException

                {
                    _serverSocket.close();
                }
                catch (IOException e)
                {
                    throw new TransportException(e);
                }
            }
        }
View Full Code Here

Examples of org.apache.qpid.transport.TransportException

                                settings.getKeyManagerFactoryAlgorithm(),
                                settings.getCertAlias());
            }
            catch (Exception e)
            {
                throw new TransportException("Error creating SSL Context", e);
            }

            if(settings.isVerifyHostname())
            {
                _hostname = settings.getHost();
            }

            try
            {
                _engine = sslCtx.createSSLEngine();
                _engine.setUseClientMode(true);
            }
            catch(Exception e)
            {
                throw new TransportException("Error creating SSL Engine", e);
            }

        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.