How to get the final group of text between two patterns with sed or awk

There are several answers on this site about how to capture text between two patterns and print out each group, but I am interested only in the last group. My output comes from echo “” | openssl s_client -showcerts -connect oidc.eks.us-east-1.amazonaws.com:443 2>&1 |\ sed -ne ‘/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p;/-END CERTIFICATE-/a\’ and I want to grab the…

Details