Examples of StartTls


Examples of rocks.xmpp.core.tls.model.StartTls

    }

    @Test
    public void unmarshalStartTls() throws XMLStreamException, JAXBException {
        String xml = "<starttls xmlns='urn:ietf:params:xml:ns:xmpp-tls'/>";
        StartTls startTls = unmarshal(xml, StartTls.class);
        Assert.assertNotNull(startTls);
    }
View Full Code Here

Examples of rocks.xmpp.core.tls.model.StartTls

        Assert.assertNotNull(failure);
    }

    @Test
    public void marshalStartTls() throws JAXBException, XMLStreamException {
        String xml = marshal(new StartTls());
        Assert.assertEquals(xml, "<starttls xmlns=\"urn:ietf:params:xml:ns:xmpp-tls\"></starttls>");
    }
View Full Code Here

Examples of rocks.xmpp.core.tls.model.StartTls

    public Status processNegotiation(Object element) throws Exception {

        Status status = Status.INCOMPLETE;
        try {
            if (element instanceof StartTls) {
                StartTls startTls = (StartTls) element;
                if (startTls.isMandatory() && !isSecure) {
                    throw new Exception("The server requires TLS, but you disabled it.");
                }
                if (isSecure) {
                    xmppSession.send(new StartTls());
                } else {
                    status = Status.IGNORE;
                }
            } else if (element instanceof Proceed) {
                status = Status.SUCCESS;
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.