Skip to content

Commit

Permalink
fix for incorrect alpn in ja4s. Issue #11
Browse files Browse the repository at this point in the history
  • Loading branch information
Timothy Noel committed Oct 11, 2023
1 parent 41c2c89 commit 4565995
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions python/ja4.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,11 @@ def to_ja4s(x, debug_stream):
alpn = '00'
if 'alpn' in x:
alpn = x['alpn']
elif 'alpn_list' in x and isinstance(x['alpn_list'], list):
alpn = x['alpn_list'][0]
elif 'alpn_list' in x:
if isinstance(x['alpn_list'], list):
alpn = x['alpn_list'][0]
else:
alpn = x['alpn_list']

x['JA4S'] = f"{ptype}{version}{ext_len}{alpn}_{x['ciphers']}_{extensions}"
x['JA4S_r'] = f"{ptype}{version}{ext_len}{alpn}_{x['ciphers']}_{','.join(x['extensions'])}"
Expand Down

0 comments on commit 4565995

Please sign in to comment.