@Override
    public ControllerHttpClient controller() {
        return Properties.apiCertificateFile()
                         .map(certificateFile -> ControllerHttpClient.withKeyAndCertificate(Properties.apiEndpoint(),
                                                                                            Properties.apiKeyFile(),
                                                                                            certificateFile))
                         .or(() -> Properties.apiKey().map(apiKey -> ControllerHttpClient.withSignatureKey(Properties.apiEndpoint(),
                                                                                                           apiKey,
                                                                                                           Properties.application())))
                         .orElseGet(() -> ControllerHttpClient.withSignatureKey(Properties.apiEndpoint(),
                                                                                Properties.apiKeyFile(),
                                                                                Properties.application()));
    }
Returns a controller client using mTLS if a key and certificate pair is provided, or signed requests otherwise.
hosted-api/src/main/java/ai/vespa/hosted/api/DefaultApiAuthenticator.java