Search code examples
javagoogle-apigoogle-text-to-speech

What are URL required to Unblock Firewall in Corporate network for accessing for Google text to speech API?


Current google Text to speech My code in java working perfectly but when uploaded to server that showing Error which is below code, as i know server is too secure so may be that needs to unblock from firewall but i could't find which are accessing in background.

I have tried proxy setup in environment variable but it's not working.

try (TextToSpeechClient textToSpeechClient = TextToSpeechClient.create()) {
        // Set the text input to be synthesized
        SynthesisInput input = SynthesisInput.newBuilder()
              .setText(strText)
              .build();

        VoiceSelectionParams voice = VoiceSelectionParams.newBuilder()
            .setLanguageCode("en-US")
            .setSsmlGender(SsmlVoiceGender.NEUTRAL)
            .build();

            // Select the type of audio file you want returned
            AudioConfig audioConfig = AudioConfig.newBuilder()
            .setAudioEncoding(AudioEncoding.MP3)
            .build();

        // Perform the text-to-speech request on the text input with the selected voice parameters and
        // audio file type
        SynthesizeSpeechResponse syntehsizeResponse = textToSpeechClient.synthesizeSpeech(input, voice,
            audioConfig);   

        // Get the audio contents from the response
        ByteString audioContents = syntehsizeResponse.getAudioContent();


Error-----------------------------------------------------------------

Caused by: javax.net.ssl.SSLHandshakeException: error:10000410:SSL routines:OPENSSL_internal:SSLV3_ALERT_HANDSHAKE_FAILURE 
        at io.grpc.netty.shaded.io.netty.handler.ssl.ReferenceCountedOpenSslEngine.shutdownWithError(ReferenceCountedOpenSslEngine.java:897)

Solution

  • speech.googleapis.com is basic link which is required to clear in firewall.