Skip to content

Commit

Permalink
fixup! Remove global API endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
pinkisemils committed Dec 19, 2024
1 parent 9b9adc7 commit 64197ae
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
3 changes: 2 additions & 1 deletion ios/MullvadVPNUITests/MullvadApi.swift
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ class MullvadApi {
let result = mullvad_api_client_initialize(
&clientContext,
apiAddress,
hostname
hostname,
false
)
try ApiError(result).throwIfErr()
}
Expand Down
8 changes: 7 additions & 1 deletion mullvad-api/src/ffi/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -236,13 +236,19 @@ impl FfiClient {
///
/// * `hostname`: pointer to a null-terminated UTF-8 string representing the hostname that will be
/// used for TLS validation.
/// * `disable_tls`: only valid when built for tests, can be ignored when consumed by Swift.
#[no_mangle]
pub unsafe extern "C" fn mullvad_api_client_initialize(
client_ptr: *mut MullvadApiClient,
api_address_ptr: *const libc::c_char,
hostname: *const libc::c_char,
#[cfg(any(feature = "api-override", test))] disable_tls: bool,
disable_tls: bool,
) -> MullvadApiError {
#[cfg(not(any(feature = "api-override", test)))]
if disable_tls {
log::error!("disable_tls has no effect when mullvad-api is built without api-override");
}

match unsafe {
FfiClient::new(
api_address_ptr,
Expand Down

0 comments on commit 64197ae

Please sign in to comment.