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

Unable to connect: StatusCode: 500, Protocol "http:" not supported. Expected "https:" #458

Closed
marcelgoya opened this issue Nov 23, 2021 · 4 comments

Comments

@marcelgoya
Copy link

OS: Sangoma Linux 7 (Core) / CentOS 7
Environment: Node.js v14
SDK: "microsoft-cognitiveservices-speech-sdk": "1.19.0"

I am running into the following connection issue once I run my client code on my server. The code works perfectly on my workstation. I turned off my firewall on the server and everything is whitelisted, so I have the suspicion that it could be related to the operating system.

Any help or pointers into the right direction are greatly appreciated.

Error:

ErrorDetails=Unable to contact server. StatusCode: 500, undefined Reason: TypeError [ERR_INVALID_PROTOCOL]: Protocol "http:" not supported. Expected "https:"

Code:

  const speechConfig = sdk.SpeechConfig.fromSubscription('ABCD', 'westeurope');
      speechConfig.speechSynthesisVoiceName = 'en-IN-NeerjaNeural'; 
      const synthesizer = new sdk.SpeechSynthesizer(speechConfig, undefined);
      
      synthesizer.speakTextAsync(text,
        async (result) => {
          // const { audioData } = result; // Arraybuffer object
          synthesizer.close();

          console.log(result);
  },
        (error) => {
          console.log(error);
          synthesizer.close();
          Sentry.captureException(error);
          APM.endTransaction(transactionId, 500);
          reject();
        });
@ianjakobs
Copy link

Did you find a solution for this?

I've been running into the same issue, and I suspect it's because of this change in the Sentry JavaScript SDK (which you appear to be using as well). It seems this SDK doesn't explicitly set a protocol, and therefore Sentry falls back to http which then causes the error.

I've tried removing the Sentry wrapper from my API handler, and also passing along an explicit https endpoint by using sdk.SpeechConfig.fromEndpoint instead of sdk.SpeechConfig.fromSubscription, but neither worked. For now I've had to downgrade to @sentry/nextjs@6.12.0, which certainly isn't ideal but then at least it works.

@alex-uspenskyi
Copy link

I'm running into the same issue after adding Sentry. Any updates here? I don't think downgrading Sentry is a good option

@lengyeld
Copy link

lengyeld commented Jan 6, 2022

Same here! And we don't really want to downgrade sentry because of this

@ianjakobs
Copy link

Still the same here too. At this point I've update Sentry and just disabled it on the server for now, but I also opened up a new issue for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants