groovyx.net.http.RESTClient支持TLSv1.2:

时间:2018-08-22 08:38:03

标签: java

我支持使用groovyx.net.http.RESTClientnexmo.com的SMS服务的应用程序。不幸的是,到目前为止,不再支持旧版TLS版本1和1.1。这对我的应用程序有影响。

据我了解,我需要升级该应用程序以支持1.2版。

代码用法的一个示例是...

...
import groovyx.net.http.RESTClient
...

class SmsService {

// settings for nexmo service
private final String apiKey = '********'
private final String apiSecret = '********'
private final String fromUk = '*********'
private final String fromUS = '**********'
private final String regionCode = "GB"
private final String nexmoUrl = 'https://rest.nexmo.com'
private final String nexmoPath = '/sms/json'

def sendSmsMessage(SmsMessageNotification smsMessageNotification){

    def restClient = new RESTClient(nexmoUrl)
     ...
     ...
            def response = restClient.get(path: nexmoPath,
                    headers: [ 'Content-Type' : 'application/x-www-form-urlencoded'],
                    query: [api_key: apiKey, api_secret: apiSecret, from: from,
                            to: phoneNumberString,
                            text: smsMessageNotification.message]
            )

如何升级此代码以支持新的TLS版本?

0 个答案:

没有答案