diff --git a/nselib/tls.lua b/nselib/tls.lua
index d40da3e15..155449778 100644
--- a/nselib/tls.lua
+++ b/nselib/tls.lua
@@ -1384,7 +1384,8 @@ end
-- Build a client_hello message
--
-- The options table has the following keys:
--- * "protocol" - The TLS protocol version string
+-- * "protocol" - The TLS protocol version string for the client_hello. This indicates the highest protocol version supported.
+-- * "record_protocol" - The TLS protocol version string for the TLS record. This indicates the lowest protocol version supported.
-- * "ciphers" - a table containing the cipher suite names. Defaults to the NULL cipher
-- * "compressors" - a table containing the compressor names. Default: NULL
-- * "extensions" - a table containing the extension names. Default: no extensions
@@ -1487,7 +1488,7 @@ function client_hello(t)
table.insert(h, pack(">s3", b))
-- Record layer version should be SSLv3 (lowest compatible record version)
- return record_write("handshake", "SSLv3", table.concat(h))
+ return record_write("handshake", t.record_protocol or "SSLv3", table.concat(h))
end
local function read_atleast(s, n)