A Cursor-On-Target generator for multicast and streaming data interfaces (TakServer).
TakServer Setup
Add a new streaming data field, go Configuration
-> Inputs and Data Feeds
-> Add Streaming Data Feed
.
Give the interface a name and select Secure Streaming TCP (TLS) CoT or Protobuf
as the protocol. Select a port and select Save
.
Create a user in the TakServer UI, then in the takserver console use the makeCert script:
cd /opt/tak/certs
sh -c "source ./makeCert.sh client [username]"
(replace [username] with the user just created)
The key and certificate for the user will be in the /opt/tag/cert/files
directory.
TakServer generates user keys which are protected by the atakatak
password, this can be removed using:
openssl rsa -in user.key -out user-nopass.key
Example - Multicast Only
let mut publisher = new;
publisher.publish;
Example - TakServer stream using TLS credentials from files
let mut publisher = new;
let ca_file = "[path_to]/truststore-intermediate-CA.pem";
let client_cert = "[path_to]/user.pem";
let client_key = "[path_to]/user-nopass.key";
publisher.set_tak_server_tls_settings;
publisher.connect;
publisher.publish;
// Required if `publisher` is dropped to ensure message is actually sent
//std::thread::sleep(std::time::Duration::from_millis(100));
Example - TakServer stream using TLS credentials from strings
let mut publisher = new;
let ca_file = r#"
Bag Attributes
friendlyName: intermediate-CA
subject=C = US, ST = STATE, L = CITY, O = TAK, OU = ORG_UNIT, CN = intermediate-CA
issuer=C = US, ST = STATE, L = CITY, O = TAK, OU = ORG_UNIT, CN = takserver-CA
-----BEGIN CERTIFICATE-----
...
-----END CERTIFICATE-----
"#;
let key = r#"
-----BEGIN PRIVATE KEY-----
...
-----END PRIVATE KEY-----
"#;
let cert = r#"
-----BEGIN CERTIFICATE-----
...
-----END CERTIFICATE-----
"#;
publisher.set_tak_server_tls_settings;
publisher.connect;
publisher.publish;
// Required if `publisher` is dropped to ensure message is actually sent
//std::thread::sleep(std::time::Duration::from_millis(100));
Example - Set position
let mut publisher = new;
publisher.set_contact;
publisher.set_position;
publisher.set_xml_detail;
publisher.publish;