ssl - groovy httpbuilder working but grails giving peer not authenticated error -
have web service consuming.
in groovy:
def http = new httpbuilder( "https://${ip}/convert/" ) http.get( path: 'mytool', query: [ name:'myname' ] ) { resp, name -> string name = name.tostring() } which works fine
however, running similar in grails:
class namingservice { def convertname(string _name) { string ip = "server/ip/end/address" string convertedname = null def http = new httpbuilder( "$ip/convert/" ) seek { http.get( path: "mytool", query: [ name:'myname' ] ) { resp, name -> convertedname = name } } grab (exception e) { println(e.message) } { homecoming convertedname } } } grails version giving: javax.net.ssl.sslpeerunverifiedexception: peer not authenticated
why grails version giving groovy version not? project stock (haven't added custom ssl certificate or anything).
it appears in pure groovy illustration hitting https endpoint explicitly:
def http = new httpbuilder( "https://${ip}/convert/" ) while in grails illustration not specifying https:
def http = new httpbuilder( "$ip/convert/" ) seek { http.get( path: "mytool", query: [ name:'myname' ] ) { resp, name -> convertedname = name }... i seek modifying first line of grails excerpt specify https protocol. without knowing endpoint can't verify.
grails ssl groovy
No comments:
Post a Comment