This is an automated email from the ASF dual-hosted git repository. davsclaus pushed a commit to branch CAMEL-27670-asterisk-ssl in repository https://gitbox.apache.org/repos/asf/camel.git
commit abcd3223fa9ad612b3f2c980c8713bdfcf872685 Author: Claus Ibsen <[email protected]> AuthorDate: Fri Nov 27 16:24:00 2026 +0100 CAMEL-27670: camel-asterisk - Add ssl option for the AMI connection The AMI connection was always plain TCP, so the AMI username and secret were sent in clear text. The new ssl endpoint option (default false) makes the consumer and the producer create the connection with createSecureManagerConnection() of asterisk-java, which uses the default SSLSocketFactory and trust store of the JVM. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Claus Ibsen <[email protected]> --- .../apache/camel/catalog/components/asterisk.json | 3 +- .../camel/catalog/docs/asterisk-component.adoc | 21 ++++ .../asterisk/AsteriskEndpointConfigurer.java | 3 + .../asterisk/AsteriskEndpointUriFactory.java | 3 +- .../apache/camel/component/asterisk/asterisk.json | 3 +- .../src/main/docs/asterisk-component.adoc | 21 ++++ .../component/asterisk/AsteriskConnection.java | 23 +++- .../camel/component/asterisk/AsteriskConsumer.java | 7 +- .../camel/component/asterisk/AsteriskEndpoint.java | 16 +++ .../camel/component/asterisk/AsteriskProducer.java | 7 +- .../camel/component/asterisk/AsteriskSslTest.java | 72 ++++++++++++ .../dsl/AsteriskEndpointBuilderFactory.java | 126 +++++++++++++++++++++ 12 files changed, 298 insertions(+), 7 deletions(-) diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/asterisk.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/asterisk.json index 947fcd84de1d..6e1ba5dcfd17 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/asterisk.json +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/asterisk.json @@ -48,6 +48,7 @@ "exceptionHandler": { "index": 5, "kind": "parameter", "displayName": "Exception Handler", "group": "consumer (advanced)", "label": "consumer,advanced", "required": false, "type": "object", "javaType": "org.apache.camel.spi.ExceptionHandler", "optionalPrefix": "consumer.", "deprecated": false, "autowired": false, "secret": false, "description": "To let the consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this option is not in use. By def [...] "exchangePattern": { "index": 6, "kind": "parameter", "displayName": "Exchange Pattern", "group": "consumer (advanced)", "label": "consumer,advanced", "required": false, "type": "enum", "javaType": "org.apache.camel.ExchangePattern", "enum": [ "InOnly", "InOut" ], "deprecated": false, "autowired": false, "secret": false, "description": "Sets the exchange pattern when the consumer creates an exchange." }, "action": { "index": 7, "kind": "parameter", "displayName": "Action", "group": "producer", "label": "producer", "required": false, "type": "enum", "javaType": "org.apache.camel.component.asterisk.AsteriskAction", "enum": [ "QUEUE_STATUS", "SIP_PEERS", "EXTENSION_STATE" ], "deprecated": false, "autowired": false, "secret": false, "description": "The AMI action that the producer sends for each message: QUEUE_STATUS for the status of the queues and their members, SIP_PEERS for the list [...] - "lazyStartProducer": { "index": 8, "kind": "parameter", "displayName": "Lazy Start Producer", "group": "producer (advanced)", "label": "producer,advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a produc [...] + "lazyStartProducer": { "index": 8, "kind": "parameter", "displayName": "Lazy Start Producer", "group": "producer (advanced)", "label": "producer,advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a produc [...] + "ssl": { "index": 9, "kind": "parameter", "displayName": "Ssl", "group": "security", "label": "security", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether to connect to the Asterisk Manager Interface (AMI) over TLS instead of plain TCP, so that the username, the password, the actions and the events are not sent in clear text. The Asterisk server must accept AMI over TL [...] } } diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/asterisk-component.adoc b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/asterisk-component.adoc index 2fe45861000a..50a800f6afda 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/asterisk-component.adoc +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/asterisk-component.adoc @@ -58,6 +58,27 @@ and `getEvents()` the events of the list, such as `QueueParamsEvent` and `QueueM EXTENSION_STATE sets the `ManagerResponse` (an `ExtensionStateResponse`) as the message body. When Asterisk answers with an error, the response is a `ManagerError`. +== TLS + +By default the consumer and the producer connect to the Asterisk Manager Interface (AMI) over plain TCP, so the +username, the password, the actions and the events are sent in clear text. Set `ssl=true` to connect over TLS: + +[source,java] +---- +from("asterisk:myVoIP?hostname=hostname&username=username&password=password&ssl=true") + .log("Received a message - ${body}"); +---- + +The Asterisk server must accept AMI over TLS on the port that the component connects to: set `tlsenable=yes` and +the `tlsbindaddr` address in the `[general]` section of `manager.conf`, together with the certificate of the server +(`tlscertfile` and `tlsprivatekey`). + +asterisk-java opens the TLS socket with the default `SSLSocketFactory` of the JVM, so the certificate of the server +is checked with the default trust store of the JVM. When the certificate is not signed by a certificate authority that +the JVM trusts, add it to a trust store and point the JVM to it with the `javax.net.ssl.trustStore` and +`javax.net.ssl.trustStorePassword` system properties. A custom `SSLContextParameters` is not supported, and the host +name of the server is not checked against the certificate. + == Examples === Producer Example diff --git a/components/camel-asterisk/src/generated/java/org/apache/camel/component/asterisk/AsteriskEndpointConfigurer.java b/components/camel-asterisk/src/generated/java/org/apache/camel/component/asterisk/AsteriskEndpointConfigurer.java index a492eb60d8df..673e8dd30cf4 100644 --- a/components/camel-asterisk/src/generated/java/org/apache/camel/component/asterisk/AsteriskEndpointConfigurer.java +++ b/components/camel-asterisk/src/generated/java/org/apache/camel/component/asterisk/AsteriskEndpointConfigurer.java @@ -35,6 +35,7 @@ public class AsteriskEndpointConfigurer extends PropertyConfigurerSupport implem case "lazystartproducer": case "lazyStartProducer": target.setLazyStartProducer(property(camelContext, boolean.class, value)); return true; case "password": target.setPassword(property(camelContext, java.lang.String.class, value)); return true; + case "ssl": target.setSsl(property(camelContext, boolean.class, value)); return true; case "username": target.setUsername(property(camelContext, java.lang.String.class, value)); return true; default: return false; } @@ -54,6 +55,7 @@ public class AsteriskEndpointConfigurer extends PropertyConfigurerSupport implem case "lazystartproducer": case "lazyStartProducer": return boolean.class; case "password": return java.lang.String.class; + case "ssl": return boolean.class; case "username": return java.lang.String.class; default: return null; } @@ -74,6 +76,7 @@ public class AsteriskEndpointConfigurer extends PropertyConfigurerSupport implem case "lazystartproducer": case "lazyStartProducer": return target.isLazyStartProducer(); case "password": return target.getPassword(); + case "ssl": return target.isSsl(); case "username": return target.getUsername(); default: return null; } diff --git a/components/camel-asterisk/src/generated/java/org/apache/camel/component/asterisk/AsteriskEndpointUriFactory.java b/components/camel-asterisk/src/generated/java/org/apache/camel/component/asterisk/AsteriskEndpointUriFactory.java index 716287f3f930..f54b6d74ee5e 100644 --- a/components/camel-asterisk/src/generated/java/org/apache/camel/component/asterisk/AsteriskEndpointUriFactory.java +++ b/components/camel-asterisk/src/generated/java/org/apache/camel/component/asterisk/AsteriskEndpointUriFactory.java @@ -24,7 +24,7 @@ public class AsteriskEndpointUriFactory extends org.apache.camel.support.compone private static final Set<String> ENDPOINT_IDENTITY_PROPERTY_NAMES; private static final Map<String, String> MULTI_VALUE_PREFIXES; static { - Set<String> props = new HashSet<>(9); + Set<String> props = new HashSet<>(10); props.add("action"); props.add("bridgeErrorHandler"); props.add("exceptionHandler"); @@ -33,6 +33,7 @@ public class AsteriskEndpointUriFactory extends org.apache.camel.support.compone props.add("lazyStartProducer"); props.add("name"); props.add("password"); + props.add("ssl"); props.add("username"); PROPERTY_NAMES = Collections.unmodifiableSet(props); Set<String> secretProps = new HashSet<>(2); diff --git a/components/camel-asterisk/src/generated/resources/META-INF/org/apache/camel/component/asterisk/asterisk.json b/components/camel-asterisk/src/generated/resources/META-INF/org/apache/camel/component/asterisk/asterisk.json index 947fcd84de1d..6e1ba5dcfd17 100644 --- a/components/camel-asterisk/src/generated/resources/META-INF/org/apache/camel/component/asterisk/asterisk.json +++ b/components/camel-asterisk/src/generated/resources/META-INF/org/apache/camel/component/asterisk/asterisk.json @@ -48,6 +48,7 @@ "exceptionHandler": { "index": 5, "kind": "parameter", "displayName": "Exception Handler", "group": "consumer (advanced)", "label": "consumer,advanced", "required": false, "type": "object", "javaType": "org.apache.camel.spi.ExceptionHandler", "optionalPrefix": "consumer.", "deprecated": false, "autowired": false, "secret": false, "description": "To let the consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this option is not in use. By def [...] "exchangePattern": { "index": 6, "kind": "parameter", "displayName": "Exchange Pattern", "group": "consumer (advanced)", "label": "consumer,advanced", "required": false, "type": "enum", "javaType": "org.apache.camel.ExchangePattern", "enum": [ "InOnly", "InOut" ], "deprecated": false, "autowired": false, "secret": false, "description": "Sets the exchange pattern when the consumer creates an exchange." }, "action": { "index": 7, "kind": "parameter", "displayName": "Action", "group": "producer", "label": "producer", "required": false, "type": "enum", "javaType": "org.apache.camel.component.asterisk.AsteriskAction", "enum": [ "QUEUE_STATUS", "SIP_PEERS", "EXTENSION_STATE" ], "deprecated": false, "autowired": false, "secret": false, "description": "The AMI action that the producer sends for each message: QUEUE_STATUS for the status of the queues and their members, SIP_PEERS for the list [...] - "lazyStartProducer": { "index": 8, "kind": "parameter", "displayName": "Lazy Start Producer", "group": "producer (advanced)", "label": "producer,advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a produc [...] + "lazyStartProducer": { "index": 8, "kind": "parameter", "displayName": "Lazy Start Producer", "group": "producer (advanced)", "label": "producer,advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a produc [...] + "ssl": { "index": 9, "kind": "parameter", "displayName": "Ssl", "group": "security", "label": "security", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether to connect to the Asterisk Manager Interface (AMI) over TLS instead of plain TCP, so that the username, the password, the actions and the events are not sent in clear text. The Asterisk server must accept AMI over TL [...] } } diff --git a/components/camel-asterisk/src/main/docs/asterisk-component.adoc b/components/camel-asterisk/src/main/docs/asterisk-component.adoc index 2fe45861000a..50a800f6afda 100644 --- a/components/camel-asterisk/src/main/docs/asterisk-component.adoc +++ b/components/camel-asterisk/src/main/docs/asterisk-component.adoc @@ -58,6 +58,27 @@ and `getEvents()` the events of the list, such as `QueueParamsEvent` and `QueueM EXTENSION_STATE sets the `ManagerResponse` (an `ExtensionStateResponse`) as the message body. When Asterisk answers with an error, the response is a `ManagerError`. +== TLS + +By default the consumer and the producer connect to the Asterisk Manager Interface (AMI) over plain TCP, so the +username, the password, the actions and the events are sent in clear text. Set `ssl=true` to connect over TLS: + +[source,java] +---- +from("asterisk:myVoIP?hostname=hostname&username=username&password=password&ssl=true") + .log("Received a message - ${body}"); +---- + +The Asterisk server must accept AMI over TLS on the port that the component connects to: set `tlsenable=yes` and +the `tlsbindaddr` address in the `[general]` section of `manager.conf`, together with the certificate of the server +(`tlscertfile` and `tlsprivatekey`). + +asterisk-java opens the TLS socket with the default `SSLSocketFactory` of the JVM, so the certificate of the server +is checked with the default trust store of the JVM. When the certificate is not signed by a certificate authority that +the JVM trusts, add it to a trust store and point the JVM to it with the `javax.net.ssl.trustStore` and +`javax.net.ssl.trustStorePassword` system properties. A custom `SSLContextParameters` is not supported, and the host +name of the server is not checked against the certificate. + == Examples === Producer Example diff --git a/components/camel-asterisk/src/main/java/org/apache/camel/component/asterisk/AsteriskConnection.java b/components/camel-asterisk/src/main/java/org/apache/camel/component/asterisk/AsteriskConnection.java index b099aec5d061..28de3949e147 100644 --- a/components/camel-asterisk/src/main/java/org/apache/camel/component/asterisk/AsteriskConnection.java +++ b/components/camel-asterisk/src/main/java/org/apache/camel/component/asterisk/AsteriskConnection.java @@ -38,27 +38,42 @@ public final class AsteriskConnection { private final String host; private final String username; private final String password; + private final boolean ssl; private ManagerConnection managerConnection; public AsteriskConnection(String host, String username, String password) { + this(host, username, password, false); + } + + /** + * Creates the connection. + * + * @param host the host name of the Asterisk server + * @param username the name of the AMI user + * @param password the secret of the AMI user + * @param ssl whether to connect to the AMI over TLS instead of plain TCP + */ + public AsteriskConnection(String host, String username, String password, boolean ssl) { this.host = host; this.username = username; this.password = password; + this.ssl = ssl; } AsteriskConnection(ManagerConnection managerConnection) { this.host = managerConnection.getHostname(); this.username = managerConnection.getUsername(); this.password = managerConnection.getPassword(); + this.ssl = managerConnection.isSsl(); this.managerConnection = managerConnection; } public void connect() { if (managerConnection == null) { - LOG.debug("asterisk connection attempt to {} username: {}", host, username); + LOG.debug("asterisk connection attempt to {} username: {} ssl: {}", host, username, ssl); ManagerConnectionFactory factory = new ManagerConnectionFactory(host, username, password); - managerConnection = factory.createManagerConnection(); + managerConnection = ssl ? factory.createSecureManagerConnection() : factory.createManagerConnection(); LOG.debug("asterisk connection established!"); } @@ -115,6 +130,10 @@ public final class AsteriskConnection { return managerConnection.sendAction(action); } + ManagerConnection getManagerConnection() { + return managerConnection; + } + public ResponseEvents sendEventGeneratingAction(EventGeneratingAction action) throws IllegalArgumentException, IllegalStateException, IOException, EventTimeoutException { diff --git a/components/camel-asterisk/src/main/java/org/apache/camel/component/asterisk/AsteriskConsumer.java b/components/camel-asterisk/src/main/java/org/apache/camel/component/asterisk/AsteriskConsumer.java index 30803a92c25b..a9fb20fd020e 100644 --- a/components/camel-asterisk/src/main/java/org/apache/camel/component/asterisk/AsteriskConsumer.java +++ b/components/camel-asterisk/src/main/java/org/apache/camel/component/asterisk/AsteriskConsumer.java @@ -32,10 +32,15 @@ public class AsteriskConsumer extends DefaultConsumer { public AsteriskConsumer(AsteriskEndpoint endpoint, Processor processor) { super(endpoint, processor); - this.connection = new AsteriskConnection(endpoint.getHostname(), endpoint.getUsername(), endpoint.getPassword()); + this.connection = new AsteriskConnection( + endpoint.getHostname(), endpoint.getUsername(), endpoint.getPassword(), endpoint.isSsl()); this.listener = new EventListener(); } + AsteriskConnection getConnection() { + return connection; + } + @Override protected void doStart() throws Exception { connection.connect(); diff --git a/components/camel-asterisk/src/main/java/org/apache/camel/component/asterisk/AsteriskEndpoint.java b/components/camel-asterisk/src/main/java/org/apache/camel/component/asterisk/AsteriskEndpoint.java index e8da57f2d032..c6ed9424ecab 100644 --- a/components/camel-asterisk/src/main/java/org/apache/camel/component/asterisk/AsteriskEndpoint.java +++ b/components/camel-asterisk/src/main/java/org/apache/camel/component/asterisk/AsteriskEndpoint.java @@ -92,6 +92,14 @@ public class AsteriskEndpoint extends DefaultEndpoint implements EndpointService @Metadata(required = true) private String password; + @UriParam(label = "security", defaultValue = "false", + description = "Whether to connect to the Asterisk Manager Interface (AMI) over TLS instead of plain TCP, so that" + + " the username, the password, the actions and the events are not sent in clear text. The" + + " Asterisk server must accept AMI over TLS on the port that the component connects to" + + " (tlsenable and tlsbindaddr in the manager.conf file). The certificate of the server is" + + " checked with the default trust store of the JVM (javax.net.ssl.trustStore).") + private boolean ssl; + public AsteriskEndpoint(String uri, AsteriskComponent component) { super(uri, component); } @@ -157,6 +165,14 @@ public class AsteriskEndpoint extends DefaultEndpoint implements EndpointService this.action = action; } + public boolean isSsl() { + return ssl; + } + + public void setSsl(boolean ssl) { + this.ssl = ssl; + } + public String getHostname() { return hostname; } diff --git a/components/camel-asterisk/src/main/java/org/apache/camel/component/asterisk/AsteriskProducer.java b/components/camel-asterisk/src/main/java/org/apache/camel/component/asterisk/AsteriskProducer.java index db1b1e5c7215..41699db54715 100644 --- a/components/camel-asterisk/src/main/java/org/apache/camel/component/asterisk/AsteriskProducer.java +++ b/components/camel-asterisk/src/main/java/org/apache/camel/component/asterisk/AsteriskProducer.java @@ -37,7 +37,8 @@ public class AsteriskProducer extends DefaultProducer { private final AsteriskConnection connection; public AsteriskProducer(AsteriskEndpoint endpoint) { - this(endpoint, new AsteriskConnection(endpoint.getHostname(), endpoint.getUsername(), endpoint.getPassword())); + this(endpoint, new AsteriskConnection( + endpoint.getHostname(), endpoint.getUsername(), endpoint.getPassword(), endpoint.isSsl())); } AsteriskProducer(AsteriskEndpoint endpoint, AsteriskConnection connection) { @@ -47,6 +48,10 @@ public class AsteriskProducer extends DefaultProducer { this.connection = connection; } + AsteriskConnection getConnection() { + return connection; + } + @Override protected void doStart() throws Exception { connection.login(); diff --git a/components/camel-asterisk/src/test/java/org/apache/camel/component/asterisk/AsteriskSslTest.java b/components/camel-asterisk/src/test/java/org/apache/camel/component/asterisk/AsteriskSslTest.java new file mode 100644 index 000000000000..8cdd18efa917 --- /dev/null +++ b/components/camel-asterisk/src/test/java/org/apache/camel/component/asterisk/AsteriskSslTest.java @@ -0,0 +1,72 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.component.asterisk; + +import org.apache.camel.test.junit6.CamelTestSupport; +import org.asteriskjava.manager.ManagerConnection; +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; + +/** + * Checks that the ssl option reaches the AMI connection of the consumer and the producer. Creating the connection does + * not connect to the server, so no Asterisk server is needed. + */ +public class AsteriskSslTest extends CamelTestSupport { + + private static final String URI = "asterisk:myVoIP?hostname=localhost&username=admin&password=secret"; + + @Test + void sslIsOffByDefault() throws Exception { + AsteriskEndpoint endpoint = context.getEndpoint(URI + "&action=QUEUE_STATUS", AsteriskEndpoint.class); + assertFalse(endpoint.isSsl()); + + assertFalse(managerConnectionOf((AsteriskProducer) endpoint.createProducer()).isSsl()); + assertFalse(managerConnectionOf((AsteriskConsumer) endpoint.createConsumer(exchange -> { + })).isSsl()); + } + + @Test + void sslReachesTheManagerConnection() throws Exception { + AsteriskEndpoint endpoint = context.getEndpoint(URI + "&action=QUEUE_STATUS&ssl=true", AsteriskEndpoint.class); + assertTrue(endpoint.isSsl()); + + ManagerConnection producerConnection = managerConnectionOf((AsteriskProducer) endpoint.createProducer()); + assertTrue(producerConnection.isSsl()); + assertEquals("localhost", producerConnection.getHostname()); + assertEquals("admin", producerConnection.getUsername()); + + ManagerConnection consumerConnection = managerConnectionOf((AsteriskConsumer) endpoint.createConsumer(exchange -> { + })); + assertTrue(consumerConnection.isSsl()); + assertEquals("localhost", consumerConnection.getHostname()); + } + + private static ManagerConnection managerConnectionOf(AsteriskProducer producer) { + AsteriskConnection connection = producer.getConnection(); + connection.connect(); + return connection.getManagerConnection(); + } + + private static ManagerConnection managerConnectionOf(AsteriskConsumer consumer) { + AsteriskConnection connection = consumer.getConnection(); + connection.connect(); + return connection.getManagerConnection(); + } +} diff --git a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/AsteriskEndpointBuilderFactory.java b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/AsteriskEndpointBuilderFactory.java index 2929bf941aaa..22a806510384 100644 --- a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/AsteriskEndpointBuilderFactory.java +++ b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/AsteriskEndpointBuilderFactory.java @@ -94,6 +94,48 @@ public interface AsteriskEndpointBuilderFactory { doSetProperty("username", username); return this; } + /** + * Whether to connect to the Asterisk Manager Interface (AMI) over TLS + * instead of plain TCP, so that the username, the password, the actions + * and the events are not sent in clear text. The Asterisk server must + * accept AMI over TLS on the port that the component connects to + * (tlsenable and tlsbindaddr in the manager.conf file). The certificate + * of the server is checked with the default trust store of the JVM + * (javax.net.ssl.trustStore). + * + * The option is a: <code>boolean</code> type. + * + * Default: false + * Group: security + * + * @param ssl the value to set + * @return the dsl builder + */ + default AsteriskEndpointConsumerBuilder ssl(boolean ssl) { + doSetProperty("ssl", ssl); + return this; + } + /** + * Whether to connect to the Asterisk Manager Interface (AMI) over TLS + * instead of plain TCP, so that the username, the password, the actions + * and the events are not sent in clear text. The Asterisk server must + * accept AMI over TLS on the port that the component connects to + * (tlsenable and tlsbindaddr in the manager.conf file). The certificate + * of the server is checked with the default trust store of the JVM + * (javax.net.ssl.trustStore). + * + * The option will be converted to a <code>boolean</code> type. + * + * Default: false + * Group: security + * + * @param ssl the value to set + * @return the dsl builder + */ + default AsteriskEndpointConsumerBuilder ssl(String ssl) { + doSetProperty("ssl", ssl); + return this; + } } /** @@ -324,6 +366,48 @@ public interface AsteriskEndpointBuilderFactory { doSetProperty("action", action); return this; } + /** + * Whether to connect to the Asterisk Manager Interface (AMI) over TLS + * instead of plain TCP, so that the username, the password, the actions + * and the events are not sent in clear text. The Asterisk server must + * accept AMI over TLS on the port that the component connects to + * (tlsenable and tlsbindaddr in the manager.conf file). The certificate + * of the server is checked with the default trust store of the JVM + * (javax.net.ssl.trustStore). + * + * The option is a: <code>boolean</code> type. + * + * Default: false + * Group: security + * + * @param ssl the value to set + * @return the dsl builder + */ + default AsteriskEndpointProducerBuilder ssl(boolean ssl) { + doSetProperty("ssl", ssl); + return this; + } + /** + * Whether to connect to the Asterisk Manager Interface (AMI) over TLS + * instead of plain TCP, so that the username, the password, the actions + * and the events are not sent in clear text. The Asterisk server must + * accept AMI over TLS on the port that the component connects to + * (tlsenable and tlsbindaddr in the manager.conf file). The certificate + * of the server is checked with the default trust store of the JVM + * (javax.net.ssl.trustStore). + * + * The option will be converted to a <code>boolean</code> type. + * + * Default: false + * Group: security + * + * @param ssl the value to set + * @return the dsl builder + */ + default AsteriskEndpointProducerBuilder ssl(String ssl) { + doSetProperty("ssl", ssl); + return this; + } } /** @@ -443,6 +527,48 @@ public interface AsteriskEndpointBuilderFactory { doSetProperty("username", username); return this; } + /** + * Whether to connect to the Asterisk Manager Interface (AMI) over TLS + * instead of plain TCP, so that the username, the password, the actions + * and the events are not sent in clear text. The Asterisk server must + * accept AMI over TLS on the port that the component connects to + * (tlsenable and tlsbindaddr in the manager.conf file). The certificate + * of the server is checked with the default trust store of the JVM + * (javax.net.ssl.trustStore). + * + * The option is a: <code>boolean</code> type. + * + * Default: false + * Group: security + * + * @param ssl the value to set + * @return the dsl builder + */ + default AsteriskEndpointBuilder ssl(boolean ssl) { + doSetProperty("ssl", ssl); + return this; + } + /** + * Whether to connect to the Asterisk Manager Interface (AMI) over TLS + * instead of plain TCP, so that the username, the password, the actions + * and the events are not sent in clear text. The Asterisk server must + * accept AMI over TLS on the port that the component connects to + * (tlsenable and tlsbindaddr in the manager.conf file). The certificate + * of the server is checked with the default trust store of the JVM + * (javax.net.ssl.trustStore). + * + * The option will be converted to a <code>boolean</code> type. + * + * Default: false + * Group: security + * + * @param ssl the value to set + * @return the dsl builder + */ + default AsteriskEndpointBuilder ssl(String ssl) { + doSetProperty("ssl", ssl); + return this; + } } /**
