Exception, if IPv6 client connect server with defined ACL 'hosts' rules


(Hagen Montag) #1

i use the ACL rule ‘hosts’, e.g.

- name: 'LOCAL_allow'
  type: 'allow'
  hosts: ['localhost', '127.0.0.1']
  verbosity: 'error'

if i connect with an IPv6 origin_address, i receveived this exception

    "type" : "class_cast_exception",
    "reason" : "java.net.Inet6Address cannot be cast to java.net.Inet4Address"

version is readonlyrest-1.16.31_es6.5.3
w/o ‘hosts’ it works fine

it works up to the first comaparsion of origin with ‘host’ is required OR always, if an IPv6 origin compared with hosts

example:
curl -4 127.0.0.1:9200/_cat/indices works with rule LOCAL_allow above
curl -6 $HOSTNAME:9200 doesnt work


(Simone Scarduzio) #2

Hey @HagK, thanks for reporting this.
Sounds like a low hanging fruit for a pull request! Would you like to become a open source contributor? I can help you if you need a hand setting up the development environment.