Hi guys,
I need to force-use TLS on the http request as SSLv3 will be discontinued by Amazon S3 (more info : https://forums.aws.amazon.com/thread.jspa?threadID=179904 )
I tried to search for more info about how to do this on corona, but could not find anything. When I test it on the Windows simulator, it seems that it is still using ssl.
I tried the sample here ( https://github.com/coronalabs/plugins-sample-openssl/blob/master/luasec/main.lua ) but couldn’t get it to work.
local openssl = require('plugin.openssl') local socket = require('socket') local plugin\_luasec\_ssl = require('plugin\_luasec\_ssl') lua\_openssl\_version, lua\_version, openssl\_version = openssl.version() print( "lua-openssl version: " .. lua\_openssl\_version, lua\_version, openssl\_version ) -- TLS/SSL client parameters (omitted) local params = { mode = "client", protocol = "tlsv1", verify = "none", options = "all", } local conn = socket.tcp() local server\_address = "54.231.32.0" local server\_port = 80 local result, error = conn:connect( server\_address, server\_port ) print( 'result, error', result, error ) if result then -- We're connected. else print( "Failed to connect to: " .. server\_address .. ":" .. tostring( server\_port ) .. " Error: " .. error ) return end -- TLS/SSL initialization conn = plugin\_luasec\_ssl.wrap(conn, params) print( 'conn', conn ) conn:dohandshake() -- conn:send( "GET / HTTP/1.0\n\n" ) local data, status, partial\_data = conn:receive("\*a") if data then print( data ) end if partial\_data then print( partial\_data ) end conn:close() -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- print( "lua-openssl secure socket test done." )
Any ideas on how to force-use TLS instead of SSL ?
Thanks