# CLIENT\_HELLO SSL TLS version insert

**URL:** <https://community.f5.com/t/client-hello-ssl-tls-version-insert/72326>\
**Category:** Technical Forums\
**Tags:** application-delivery\
**Created:** [May 17, 2023, 7:34am UTC](https://community.f5.com/t/client-hello-ssl-tls-version-insert/72326 "2023-05-17T07:34:45Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![JO\_JO](https://avatars.discourse-cdn.com/v4/letter/j/c5a1d2/32.png) [@JO\_JO](https://community.f5.com/u/JO_JO)\
**Post date:** [May 17, 2023, 7:34am UTC](https://community.f5.com/t/client-hello-ssl-tls-version-insert/72326/1 "2023-05-17T07:34:45Z")

</div>

CLIENT\_HELLO SSL/TLS version insert

HELLO,

I want to insert the SSLv3, TLSv1, TLSv1.1 version in the HTTP header

The name of the HTTP header is “version”

I must use irule

when CLIENTSSL\_CLIENTHELLO {  
set version [SSL::cipher version]  
}

when HTTP\_REQUEST {  
if {[class match $version equals tls-version]} {  
HTTP::header “version = $version”  
}  
}

In the data group tls-version, I defined&nbsp;SSLv3,TLSv1, TLSv1.1

It does not work

What’s the problem?

Is there a better way?

---

<div class="post-metadata">

**Author:** ![423479](https://avatars.discourse-cdn.com/v4/letter/4/e274bd/32.png) [@423479](https://community.f5.com/u/423479)\
**Post date:** [May 17, 2023, 8:09am UTC](https://community.f5.com/t/client-hello-ssl-tls-version-insert/72326/2 "2023-05-17T08:09:56Z")

</div>

Hello,

The problem with your iRule is that you’re attempting to compare the value of the version variable to the data group tls-version using the class match command. However, the class match command is used to match against a predefined class, not a data group.

To fix this issue, you can modify your iRule as follows:

when CLIENTSSL\_CLIENTHELLO {  
set version [SSL::cipher version]  
}

when HTTP\_REQUEST {  
if {[class match [string toupper $version] equals tls-version]} {  
HTTP::header replace “version” “$version”  
}  
}

In this updated iRule, we convert the version variable to uppercase using string toupper to ensure a case-insensitive match. Then, we compare it to the class tls-version. If there is a match, we replace the existing version header (if present) with the value of the version variable.

Make sure you have defined the data group tls-version properly with the values “SSLv3”, “TLSv1”, and “TLSv1.1”.

Note: It’s important to mention that SSLv3 and TLSv1.1 are considered insecure and deprecated protocols. It’s highly recommended to use more secure versions like TLSv1.2 or TLSv1.3.

---

<div class="post-metadata">

**Author:** ![Enes\_Afsin\_Al](https://d1p9zq3aats0t8.cloudfront.net/user_avatar/community.f5.com/enes_afsin_al/32/15359_2.png) [@Enes\_Afsin\_Al](https://community.f5.com/u/Enes_Afsin_Al)\
**Post date:** [May 17, 2023, 11:23am UTC](https://community.f5.com/t/client-hello-ssl-tls-version-insert/72326/3 "2023-05-17T11:23:04Z")

</div>

Hi JO\_JO,

“insert” command is required to add http header. Can you try this iRule?

```tcl
when HTTP_REQUEST {
	if { [class match [SSL::cipher version] equals tls-version] } {
		HTTP::header insert "version" [SSL::cipher version]
	}
}

```
