make it work for older cowboy versions
Support certificate chain
Filter metadata location by binding