4

I'm trying to search via Google to find a particular Ruby source file responsible for an issue and the OpenSSL function of interest is SSL_get_peer_certificate. If I find the function I'll probably find the relevant Ruby code.

However, searching Ruby source files is not returning expected results. I'm searching with the following, and it returned zero results.

SSL_get_peer_certificate site:github.com/ruby/ruby

This returned a page or two of results, which is almost certainly wrong (it should have produced a cornucopia):

ssl site:github.com/ruby/ruby

How does one search GitHub projects?

(This is related to a question on Stack Overflow, Verifying only that a SSL certificate is signed by a CA? where I believe the problem is Ruby is performing host name matching only based on the CN, and not the SAN.)

  • Ah, OK thanks. According to @Benjamin, the robots.txt` allows Google to index it, so Google should be crawling the project. Whether Google indexes it is a different story (apparently not - q.v.). – jww Jun 19 '14 at 10:15
  • select-menu-item js-navigation-item links on the github pages have rel="nofollow" which will most likely stop Google spidering any further than the project main pages. – Mike Ridyard Jun 25 '14 at 8:30
2

You need to combine site: and inurl: in order to narrow your results as desired.

In your example it would be:

SSL_get_peer_certificate site:github.com inurl:ruby

This will search for "SSL_get_peer_certificate" on the github.com domain, and only if "ruby" is part of the URL, as it would be in github.com/ruby/ruby

But you can also use GitHub.com itself for code searches across all repos, or just down to a single repository.

In this case it would bring up ruby/ext/openssl/ossl_ssl.c as containing the reference you're looking for.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.