I have seen Where to find Java 6 JSSE/JCE Source Code? and asked the question myself How to get JRE/JDK with matching source? but I don\'t either of these was specific enough
I ended up doing the following on Mac OS X High Sierra 10.13.4 running eclipse luna and javac 1.8.0_171
On a ubuntu machine also running open jdk and javac 1.8.0_171
apt-get install openjdk-8-source
cd tmp
unzip /usr/lib/jvm/openjdk-8/src.zip "sun/security/*"
zip -r jsse-src sun
I didn't include the com/sun/net/ssl stuff but was good enough in my case.
I then copied jsse-src.zip
to the mac at /Library/Java/JavaVirtualMachines/jdk1.8.0_171.jdk/Contents/Home/
and pointed eclipse to that.