java - 解锁企业网络中的防火墙以访问 Google 文本到语音 API 需要什么 URL?
问题描述
当前的谷歌文本到语音我的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 是需要在防火墙中清除的基本链接。
推荐阅读
- c# - ObservableCollection 在 foreach 循环中无缘无故地清空自己
- r - 基于变量运行定义序列,并使用来自另一个变量的附加条件
- codemirror - Codemirror-grammar 如何使关键字检查不区分大小写
- c# - 如何将 C 联合转换为 C#?
- mysql - 我应该什么时候关闭 MySQL 中的语句
- list - 如何在haskell中生成具有自己数据类型的列表
- xml - 如何为一周中的几天编写有效的 xsd ?
- java - 如何使用 ObjectMapper 从空 JSON 文件反序列化为 Java 对象
- litho - 如何在 LayoutSpec 或 Android 中的 XML 中添加 MountSpec 组件
- java - 使用递归插入二叉树