URL 需要什么才能在公司网络中取消阻止防火墙以访问 Google 文本到语音 API?
What are URL required to Unblock Firewall in Corporate network for accessing for Google text to speech API?
当前 google 文字转语音 我在 java 中的代码工作正常,但是当上传到服务器时显示代码下方的错误,因为我知道服务器太安全所以可能需要取消阻止防火墙,但我找不到哪些正在后台访问。
我已经尝试在环境变量中设置代理,但它不起作用。
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)
speech.googleapis.com 是基本的 link,需要在防火墙中清除。
当前 google 文字转语音 我在 java 中的代码工作正常,但是当上传到服务器时显示代码下方的错误,因为我知道服务器太安全所以可能需要取消阻止防火墙,但我找不到哪些正在后台访问。
我已经尝试在环境变量中设置代理,但它不起作用。
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)
speech.googleapis.com 是基本的 link,需要在防火墙中清除。