use of org.apache.cxf.configuration.security.IncludeProtocols in project cxf by apache.
the class JettyHTTPServerEngineBeanDefinitionParser method mapTLSServerParameters.
private void mapTLSServerParameters(Element e, BeanDefinitionBuilder bean) {
BeanDefinitionBuilder paramsbean = BeanDefinitionBuilder.rootBeanDefinition(TLSServerParametersConfig.TLSServerParametersTypeInternal.class);
// read the attributes
NamedNodeMap as = e.getAttributes();
for (int i = 0; i < as.getLength(); i++) {
Attr a = (Attr) as.item(i);
if (a.getNamespaceURI() == null) {
String aname = a.getLocalName();
if ("jsseProvider".equals(aname) || "secureSocketProtocol".equals(aname)) {
paramsbean.addPropertyValue(aname, a.getValue());
}
}
}
// read the child elements
Node n = e.getFirstChild();
while (n != null) {
if (Node.ELEMENT_NODE != n.getNodeType() || !SECURITY_NS.equals(n.getNamespaceURI())) {
n = n.getNextSibling();
continue;
}
String ename = n.getLocalName();
// Schema should require that no more than one each of these exist.
String ref = ((Element) n).getAttribute("ref");
if ("keyManagers".equals(ename)) {
if (ref != null && ref.length() > 0) {
paramsbean.addPropertyReference("keyManagersRef", ref);
} else {
mapElementToJaxbProperty((Element) n, paramsbean, ename, KeyManagersType.class);
}
} else if ("trustManagers".equals(ename)) {
if (ref != null && ref.length() > 0) {
paramsbean.addPropertyReference("trustManagersRef", ref);
} else {
mapElementToJaxbProperty((Element) n, paramsbean, ename, TrustManagersType.class);
}
} else if ("cipherSuites".equals(ename)) {
mapElementToJaxbProperty((Element) n, paramsbean, ename, CipherSuites.class);
} else if ("cipherSuitesFilter".equals(ename)) {
mapElementToJaxbProperty((Element) n, paramsbean, ename, FiltersType.class);
} else if ("excludeProtocols".equals(ename)) {
mapElementToJaxbProperty((Element) n, paramsbean, ename, ExcludeProtocols.class);
} else if ("includeProtocols".equals(ename)) {
mapElementToJaxbProperty((Element) n, paramsbean, ename, IncludeProtocols.class);
} else if ("secureRandomParameters".equals(ename)) {
mapElementToJaxbProperty((Element) n, paramsbean, ename, SecureRandomParameters.class);
} else if ("clientAuthentication".equals(ename)) {
mapElementToJaxbProperty((Element) n, paramsbean, ename, ClientAuthentication.class);
} else if ("certConstraints".equals(ename)) {
mapElementToJaxbProperty((Element) n, paramsbean, ename, CertificateConstraintsType.class);
} else if ("certAlias".equals(ename)) {
paramsbean.addPropertyValue(ename, n.getTextContent());
}
n = n.getNextSibling();
}
BeanDefinitionBuilder jaxbbean = BeanDefinitionBuilder.rootBeanDefinition(TLSServerParametersConfig.class);
jaxbbean.addConstructorArgValue(paramsbean.getBeanDefinition());
bean.addPropertyValue("tlsServerParameters", jaxbbean.getBeanDefinition());
}
use of org.apache.cxf.configuration.security.IncludeProtocols in project cxf by apache.
the class UndertowHTTPServerEngineBeanDefinitionParser method mapTLSServerParameters.
private void mapTLSServerParameters(Element e, BeanDefinitionBuilder bean) {
BeanDefinitionBuilder paramsbean = BeanDefinitionBuilder.rootBeanDefinition(TLSServerParametersConfig.TLSServerParametersTypeInternal.class);
// read the attributes
NamedNodeMap as = e.getAttributes();
for (int i = 0; i < as.getLength(); i++) {
Attr a = (Attr) as.item(i);
if (a.getNamespaceURI() == null) {
String aname = a.getLocalName();
if ("jsseProvider".equals(aname) || "secureSocketProtocol".equals(aname)) {
paramsbean.addPropertyValue(aname, a.getValue());
}
}
}
// read the child elements
Node n = e.getFirstChild();
while (n != null) {
if (Node.ELEMENT_NODE != n.getNodeType() || !SECURITY_NS.equals(n.getNamespaceURI())) {
n = n.getNextSibling();
continue;
}
String ename = n.getLocalName();
// Schema should require that no more than one each of these exist.
String ref = ((Element) n).getAttribute("ref");
if ("keyManagers".equals(ename)) {
if (ref != null && ref.length() > 0) {
paramsbean.addPropertyReference("keyManagersRef", ref);
} else {
mapElementToJaxbProperty((Element) n, paramsbean, ename, KeyManagersType.class);
}
} else if ("trustManagers".equals(ename)) {
if (ref != null && ref.length() > 0) {
paramsbean.addPropertyReference("trustManagersRef", ref);
} else {
mapElementToJaxbProperty((Element) n, paramsbean, ename, TrustManagersType.class);
}
} else if ("cipherSuites".equals(ename)) {
mapElementToJaxbProperty((Element) n, paramsbean, ename, CipherSuites.class);
} else if ("cipherSuitesFilter".equals(ename)) {
mapElementToJaxbProperty((Element) n, paramsbean, ename, FiltersType.class);
} else if ("excludeProtocols".equals(ename)) {
mapElementToJaxbProperty((Element) n, paramsbean, ename, ExcludeProtocols.class);
} else if ("includeProtocols".equals(ename)) {
mapElementToJaxbProperty((Element) n, paramsbean, ename, IncludeProtocols.class);
} else if ("secureRandomParameters".equals(ename)) {
mapElementToJaxbProperty((Element) n, paramsbean, ename, SecureRandomParameters.class);
} else if ("clientAuthentication".equals(ename)) {
mapElementToJaxbProperty((Element) n, paramsbean, ename, ClientAuthentication.class);
} else if ("certConstraints".equals(ename)) {
mapElementToJaxbProperty((Element) n, paramsbean, ename, CertificateConstraintsType.class);
} else if ("certAlias".equals(ename)) {
paramsbean.addPropertyValue(ename, n.getTextContent());
}
n = n.getNextSibling();
}
BeanDefinitionBuilder jaxbbean = BeanDefinitionBuilder.rootBeanDefinition(TLSServerParametersConfig.class);
jaxbbean.addConstructorArgValue(paramsbean.getBeanDefinition());
bean.addPropertyValue("tlsServerParameters", jaxbbean.getBeanDefinition());
}
Aggregations