How to send requests to an external API using PPF (https)

I use Payment Provider Framework to create a payment connector, I am modifying the default methods trying to get luck to access to an external API (my current API for the payment method) but there are some issues that I can not solve.

When I use https in the request I got this response.

Client network socket disconnected before secure TLS connection was established

I reviewed some questions and answers here in the forum and I saw that some people uses http and they add a header to force the use of https, like this.
'X-VTEX-Use-Https': true,

But making that change I got Request failed with status code 401, if I send the request directly using POSTMAN I got a successful response.

Here the curl:
curl --location 'https://emojihub.yurace.pro/api/random'

Here the code

import axios from "axios";
.
.
.
export default class MyExampleConnector extends PaymentProvider {

async cancel(cancellation: CancellationRequest): Promise<CancellationResponse> { 
        
        const options = {
            headers: {
                'X-VTEX-Use-Https': true                
              }
            };
          try {            
            const req = await axios.get('http://emojihub.yurace.pro/api/random', options);
            //Dummy response
            const response: CancellationResponse = {
                message: req.status.toString() || '',
                cancellationId: cancellation.tid,
                code: 'cancel-manually',
                paymentId: cancellation.paymentId

            }
            return response;

            
        } catch (error) {
           throw new Error(error.message || '');
        }
       }
}

Hello friend, how are you?

Regarding the error 401, it’s related to permission or authentication. As I understood, you are trying to use a payment API, which is private, so you need to pass access tokens. Are you passing them on the backend?

As for the TLS error, it’s because it’s taking too long to return the data, probably related to the 401 error as well. But in the worst case, you can try increasing the timeout for your axios request (Request Config | Axios Docs).