GithubHelp home page GithubHelp logo

Comments (4)

amuramatsu avatar amuramatsu commented on August 11, 2024

xyzzyの実装は正しくて、コネクション自体が終わっていない(HTTP 1.1はデフォルトでkeep-aliveになっているから)だけではないでしょうか。
(yahoo はkeep-aliveを実装していない?)

(format stream "GET / HTTP/1.1\n")(format stream "GET / HTTP/1.0\n")にするか、GETの後に
(format stream "Connection: close\n")
を付ければ、リクエスト毎にコネクションが切断されるようになって、所望の結果が得られるのではないかと思います。

from xyzzy.

kosh04 avatar kosh04 commented on August 11, 2024

確かにコネクションを切断するように指定すれば上のコードはうまく動作するみたいですね。ありがとうございます。

ただ、サイトによっては実行中に別の問題が発生するみたいです。
例えば httpbin.org では

(with-open-stream (stream (connect "httpbin.org" "https" :ssl t))
  (format stream "GET /ip HTTP/1.1\n")
  (format stream "Host: httpbin.org\n")
  (format stream "Connection: close\n")
  (format stream "\n")
  (let (line)
    (while (setq line (read-line stream nil))
      (insert line "\n"))))
;;-> 通信内容が出力される
HTTP/1.1 200 OK
Server: nginx
Date: Thu, 14 Jan 2016 18:49:00 GMT
Content-Type: application/json
Content-Length: 31
Connection: close
Access-Control-Allow-Origin: *
Access-Control-Allow-Credentials: true

{
  "origin": "127.0.0.1"
}
;; エラーメッセージ: Disconnect: 指定されたハンドルが無効です 

*Trace Output* バッファを見ると「DecryptMessage (context expired): このコンテキストは、期限が切れているので使用できません。 」と出力されていて、read-line 関数の読み込み途中にSSLソケットストリームが無効になる(?)ようなエラーが発生してしまうため、解決したとは言いがたい状態です…。

from xyzzy.

amuramatsu avatar amuramatsu commented on August 11, 2024

どうも、src/sockssl.cc 内の sockssl::decrypt_data() で、DecryptMessage()が返すSEC_I_CONTEXT_EXPIREDをエラーとして扱っているのが原因のようです。
他のソフトをいくつか見てみましたが、無視してセッションクローズしてしまうのが正しい?

件のサイトでもエラーが出ないようなパッチを作ってみましたが、Windowsはよく分かっていないのでこれでいいのかどうか。

https://gist.github.com/amuramatsu/8c3b63b05d8a23a70741

from xyzzy.

kosh04 avatar kosh04 commented on August 11, 2024

パッチを当てて再ビルドしてみたら通りました 👍

改善の余地はありそうですが、一応このパッチはPull Requestとして投げてみてはどうでしょうか。

from xyzzy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.