Azure-Samples / cognitive-services-speech-sdk

Sample code for the Microsoft Cognitive Services Speech SDK
MIT License
2.83k stars 1.83k forks source link

Connection failed Code 2460. #688

Closed stkevintan closed 4 years ago

stkevintan commented 4 years ago

Describe the bug Hello I'm using the dotnet core version of the speech sdk. Sample code from offical doc:

static async Task SynthesizeAudioAsync() 
{
    var config = SpeechConfig.FromSubscription("YourSubscriptionKey", "YourServiceRegion");
    using var synthesizer = new SpeechSynthesizer(config, null);

    var result = await synthesizer.SpeakTextAsync("Getting the response as an in-memory stream.");
    using var stream = AudioDataStream.FromResult(result);
}

this code works perfectly in windows / Ubuntu(vm from azure), but cannot work in Archlinux. here is the error:

Connection failed (no connection to the remote host). Internal error: 1. Error details: 2460. Please check network connection, firewall setting, and the region name used to create speech factory. USP state: 2. Received audio size: 0bytes.

the network environment is same as the windows so I don't think there are any network failure existing. and I haven't set any firewall yet.

here are some sys-info:

$ pacman -F libssl.so.1.0.0
core/openssl-1.0 1.0.2.u-1 [installed]
    usr/lib/libssl.so.1.0.0
$ cat /etc/resolv.conf
# Generated by dhcpcd from eno1.dhcp, eno1.dhcp6
# /etc/resolv.conf.head can replace this line
search corp.microsoft.com
nameserver 10.50.50.50
nameserver 10.50.10.50
$ dotnet --info
.NET Core SDK (reflecting any global.json):
 Version:   3.1.103
 Commit:    6f74c4a1dd

Runtime Environment:
 OS Name:     arch
 OS Version:  
 OS Platform: Linux
 RID:         arch-x64
 Base Path:   /usr/share/dotnet/sdk/3.1.103/

Host (useful for support):
  Version: 3.1.3
  Commit:  ed88943d24

.NET Core SDKs installed:
  3.1.103 [/usr/share/dotnet/sdk]

.NET Core runtimes installed:
  Microsoft.NETCore.App 3.1.3 [/usr/share/dotnet/shared/Microsoft.NETCore.App]

To install additional .NET Core runtimes or SDKs:
  https://aka.ms/dotnet-download

To Reproduce Run the offical C# samples.

Expected behavior Connection successfully

Version of the Cognitive Services Speech SDK Which version of the SDK are you using.

Platform, Operating System, and Programming Language

Additional context

Connection failed (no connection to the remote host). Internal error: 1. Error details: 2460. Please check network connection, firewall setting, and the region name used to create speech factory. USP state: 2. Received audio size: 0bytes.
pankopon commented 4 years ago

You probably need to set SSL_CERT_DIR or SSL_CERT_FILE to indicate where SSL certificates are located on Arch Linux. See https://docs.microsoft.com/en-us/azure/cognitive-services/speech-service/how-to-configure-openssl-linux for instructions.

pankopon commented 4 years ago

Closed as resolved since no further comments from the customer.

stkevintan commented 4 years ago

thanks ,it works @pankopon