rabbit-shocker / rabbiter

Rabbiter is a twitter client for Rabbit
http://rabbit-shocker.org/en/rabbiter/
Other
2 stars 2 forks source link

rabbiter.rb:155:in `connect_to_host': TLS support is not available (GLib::Error) #2

Closed znz closed 11 years ago

znz commented 11 years ago

Mac OS X + homebrew の環境で #1 の show_uri はコメントアウトして無理矢理通して、続けようとすると

rabbiter-2.0.0/lib/rabbiter.rb:155:in `connect_to_host': TLS support is not available (GLib::Error)

という例外になって使えませんでした。

kou commented 11 years ago

うーん、glib-networkingをインストールするとどうなるか試してもらえませんか?

znz commented 11 years ago

brew install glib-networking してみたら、次は証明書の問題で止まりました。

.../rabbiter-2.0.0/lib/rabbiter.rb: line 155
   GLib-CRITICAL **:gboolean g_file_get_contents(const gchar *, gchar **, gsize *, GError **): assertion `filename != NULL' failed
.../rabbiter-2.0.0/lib/rabbiter.rb:155:in `connect_to_host': Unacceptable TLS certificate (GLib::Error)
kou commented 11 years ago

OS XのときもWIndowsのときのように証明書のチェックをしないようにしたほうがよさそうですね。。。 残念ですけど。。。

znz commented 11 years ago

github.com/megous/megatools/issues/24#issuecomment-19168016 に似たような話があったのですが、 homebrew の glib-networking は configure に --without-ca-certificates が指定されているのが原因で、 brew edit glib-networking で --with-ca-certificates=/path/to/the/cacerts/file を指定するようにすれば良いってことみたいでした。

colindean commented 11 years ago

I encountered this today.

I installed glib-networking with brew install glib-networking. GNUTLS complains about not having certificates.

We need to get Homebrew to enable cURL's CA bundle for use with glib-networking.

The certificates are installed to brew --prefix curl-ca-bundle/share/ca-bundle.crt

My modification to the glib-networking Formula, in full, which is located at /usr/local/Library/Formula/glib-networking.rb:

require 'formula'

class GlibNetworking < Formula
  homepage 'https://launchpad.net/glib-networking'
  url 'http://ftp.gnome.org/pub/GNOME/sources/glib-networking/2.36/glib-networking-2.36.2.tar.xz'
  sha256 '2108d55b0af3eea56ce256830bcaf1519d6337e0054ef2eff80f2c0ef0eb23f9'

  depends_on 'pkg-config' => :build
  depends_on 'xz' => :build
  depends_on 'intltool' => :build
  depends_on 'gettext'
  depends_on 'glib'
  depends_on 'gnutls'
  depends_on 'gsettings-desktop-schemas'
  depends_on 'curl-ca-bundle' => :optional

  def install
    system "./configure", "--disable-dependency-tracking",
                          certs_options,
                          "--prefix=#{prefix}"
    system "make install"
  end

  def certs_options
    return "--without-ca-certificates" if !build.with? "curl-ca-bundle"
    curl_ca_bundle = Formula.factory('curl-ca-bundle').opt_prefix
    "--with-ca-certificates=#{curl_ca_bundle}/share/ca-bundle.crt"
  end
end

Once I modified the formula and did brew reinstall glib-networking --with-curl-ca-bundle, I was able to start rabbiter and show it working.

Edit: Replaced with my final code.

colindean commented 11 years ago

I've submitted this as PR mxcl/homebrew#22180.

kou commented 11 years ago

Thanks!!! I close this issue!