Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

broadcastify: add option to disable ssl certificate verification #757

Merged
merged 1 commit into from
Jan 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 24 additions & 23 deletions docs/CONFIGURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,29 +103,30 @@ Here is a map of the different sections of the *config.json* file:

### Global Configs

| Key | Required | Default Value | Type | Description |
| ----------------------- | :------: | ----------------- | ----------------------------------------------------------- | ------------------------------------------------------------ |
| ver | ✓ | | number | the version of formatting for the config file. **This should be set to 2**. Trunk Recorder will not start without this set. |
| sources | ✓ | | array of JSON objects<br />[{}] | An array of JSON formatted [Source Objects](#source-object) that define the different SDRs available. Source Objects are described below. |
| systems | ✓ | | array of JSON objects<br />[{}] | An array of JSON formatted [System Objects](#system-object) that define the trunking systems that will be recorded. System Objects are described below. |
| plugins | | | array of JSON objects<br />[{}] | An array of JSON formatted [Plugin Objects](#plugin-object) that define the different plugins to use. Refer to the [Plugin System](notes/PLUGIN-SYSTEM.md) documentation for more details. |
| defaultMode | | "digital" | **"analog"** or **"digital"** | Default mode to use when a talkgroups is not listed in the **talkgroupsFile**. The options are *digital* or *analog*. The default is *digital*. This argument is global and not system-specific, and only affects `smartnet` trunking systems which can have both analog and digital talkpaths. |
| captureDir | | current directory | string | The complete path to the directory where recordings should be saved. |
| callTimeout | | 3 | number | A Call will stop recording and save if it has not received anything on the control channel, after this many seconds. |
| uploadServer | | | string | The URL for uploading to OpenMHz. The default is an empty string. See the Config tab for your system in OpenMHz to find what the value should be. |
| broadcastifyCallsServer | | | string | The URL for uploading to Broadcastify Calls. The default is an empty string. Refer to [Broadcastify's wiki](https://wiki.radioreference.com/index.php/Broadcastify-Calls-API) for the upload URL. |
| | | | | |
| logFile | | false | **true** / **false** | Save the console output to a file. |
| frequencyFormat | | "exp" | **"exp" "mhz"** or **"hz"** | the display format for frequencies to display in the console and log file. |
| controlWarnRate | | 10 | number | Log the control channel decode rate when it falls bellow this threshold. The value of *-1* will always log the decode rate. |
| statusAsString | | true | **true** / **false** | Show status as strings instead of numeric values |
| statusServer | | | string | The URL for a WebSocket connect. Trunk Recorder will send JSON formatted update message to this address. HTTPS is currently not supported, but will be in the future. OpenMHz does not support this currently. [JSON format of messages](./notes/STATUS-JSON.md) |
| broadcastSignals | | true | **true** / **false** | Broadcast decoded signals to the status server. |
| logLevel | | "info" | **"trace" "debug" "info" "warning" "error"** or **"fatal"** | the logging level to display in the console and log file. The options are *trace*, *debug*, *info*, *warning*, *error* & *fatal*. The default is *info*. |
| debugRecorder | | true | **true** / **false** | Will attach a debug recorder to each Source. The debug recorder will allow you to examine the channel of a call be recorded. There is a single Recorder per Source. It will monitor a recording and when it is done, it will monitor the next recording started. The information is sent over a network connection and can be viewed using the `udp-debug.grc` graph in GnuRadio Companion |
| debugRecorderPort | | 1234 | number | The network port that the Debug Recorders will start on. For each Source an additional Debug Recorder will be added and the port used will be one higher than the last one. For example the ports for a system with 3 Sources would be: 1234, 12345, 1236. |
| debugRecorderAddress | | "127.0.0.1" | string | The network address of the computer that will be monitoring the Debug Recorders. UDP packets will be sent from Trunk Recorder to this computer. The default is *"127.0.0.1"* which is the address used for monitoring on the same computer as Trunk Recorder. |
| audioStreaming | | false | **true** / **false** | whether or not to enable the audio streaming callbacks for plugins. |
| Key | Required | Default Value | Type | Description |
| ---------------------------- | :------: | ----------------- | ----------------------------------------------------------- | ------------------------------------------------------------ |
| ver | ✓ | | number | the version of formatting for the config file. **This should be set to 2**. Trunk Recorder will not start without this set. |
| sources | ✓ | | array of JSON objects<br />[{}] | An array of JSON formatted [Source Objects](#source-object) that define the different SDRs available. Source Objects are described below. |
| systems | ✓ | | array of JSON objects<br />[{}] | An array of JSON formatted [System Objects](#system-object) that define the trunking systems that will be recorded. System Objects are described below. |
| plugins | | | array of JSON objects<br />[{}] | An array of JSON formatted [Plugin Objects](#plugin-object) that define the different plugins to use. Refer to the [Plugin System](notes/PLUGIN-SYSTEM.md) documentation for more details. |
| defaultMode | | "digital" | **"analog"** or **"digital"** | Default mode to use when a talkgroups is not listed in the **talkgroupsFile**. The options are *digital* or *analog*. The default is *digital*. This argument is global and not system-specific, and only affects `smartnet` trunking systems which can have both analog and digital talkpaths. |
| captureDir | | current directory | string | The complete path to the directory where recordings should be saved. |
| callTimeout | | 3 | number | A Call will stop recording and save if it has not received anything on the control channel, after this many seconds. |
| uploadServer | | | string | The URL for uploading to OpenMHz. The default is an empty string. See the Config tab for your system in OpenMHz to find what the value should be. |
| broadcastifyCallsServer | | | string | The URL for uploading to Broadcastify Calls. The default is an empty string. Refer to [Broadcastify's wiki](https://wiki.radioreference.com/index.php/Broadcastify-Calls-API) for the upload URL. |
| broadcastifySslVerifyDisable | | false | **true** / **false** | Optionally disable SSL verification for Broadcastify uploads, given their apparent habit of letting their SSL certificate expire |
| | | | | |
| logFile | | false | **true** / **false** | Save the console output to a file. |
| frequencyFormat | | "exp" | **"exp" "mhz"** or **"hz"** | the display format for frequencies to display in the console and log file. |
| controlWarnRate | | 10 | number | Log the control channel decode rate when it falls bellow this threshold. The value of *-1* will always log the decode rate. |
| statusAsString | | true | **true** / **false** | Show status as strings instead of numeric values |
| statusServer | | | string | The URL for a WebSocket connect. Trunk Recorder will send JSON formatted update message to this address. HTTPS is currently not supported, but will be in the future. OpenMHz does not support this currently. [JSON format of messages](./notes/STATUS-JSON.md) |
| broadcastSignals | | true | **true** / **false** | Broadcast decoded signals to the status server. |
| logLevel | | "info" | **"trace" "debug" "info" "warning" "error"** or **"fatal"** | the logging level to display in the console and log file. The options are *trace*, *debug*, *info*, *warning*, *error* & *fatal*. The default is *info*. |
| debugRecorder | | true | **true** / **false** | Will attach a debug recorder to each Source. The debug recorder will allow you to examine the channel of a call be recorded. There is a single Recorder per Source. It will monitor a recording and when it is done, it will monitor the next recording started. The information is sent over a network connection and can be viewed using the `udp-debug.grc` graph in GnuRadio Companion |
| debugRecorderPort | | 1234 | number | The network port that the Debug Recorders will start on. For each Source an additional Debug Recorder will be added and the port used will be one higher than the last one. For example the ports for a system with 3 Sources would be: 1234, 12345, 1236. |
| debugRecorderAddress | | "127.0.0.1" | string | The network address of the computer that will be monitoring the Debug Recorders. UDP packets will be sent from Trunk Recorder to this computer. The default is *"127.0.0.1"* which is the address used for monitoring on the same computer as Trunk Recorder. |
| audioStreaming | | false | **true** / **false** | whether or not to enable the audio streaming callbacks for plugins. |



Expand Down
12 changes: 12 additions & 0 deletions plugins/broadcastify_uploader/broadcastify_uploader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ struct Broadcastify_System_Key {
struct Broadcastify_Uploader_Data {
std::vector<Broadcastify_System_Key> keys;
std::string bcfy_calls_server;
bool ssl_verify_disable;
};

class Broadcastify_Uploader : public Plugin_Api {
Expand Down Expand Up @@ -181,6 +182,12 @@ class Broadcastify_Uploader : public Plugin_Api {
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_callback);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &response_buffer);

// broadcastify seems to make a habit out of letting their ssl certs expire
if (this->data.ssl_verify_disable) {
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L);
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0L);
}

curl_multi_add_handle(multi_handle, curl);

curl_multi_perform(multi_handle, &still_running);
Expand Down Expand Up @@ -334,6 +341,11 @@ class Broadcastify_Uploader : public Plugin_Api {
return 1;
}

this->data.ssl_verify_disable = cfg.get<bool>("broadcastifySslVerifyDisable", false);
if (this->data.ssl_verify_disable) {
BOOST_LOG_TRIVIAL(info) << "Broadcastify SSL Verify Disabled";
}

BOOST_FOREACH (boost::property_tree::ptree::value_type &node, cfg.get_child("systems")) {
boost::optional<boost::property_tree::ptree &> broadcastify_exists = node.second.get_child_optional("broadcastifyApiKey");
if (broadcastify_exists) {
Expand Down