亚洲av成人无遮挡网站在线观看,少妇性bbb搡bbb爽爽爽,亚洲av日韩精品久久久久久,兔费看少妇性l交大片免费,无码少妇一区二区三区

  免費注冊 查看新帖 |

Chinaunix

  平臺 論壇 博客 文庫
最近訪問板塊 發(fā)新帖
查看: 1912 | 回復: 0
打印 上一主題 下一主題

請教一個Openssl的問題,著急。。。。 [復制鏈接]

論壇徽章:
0
跳轉到指定樓層
1 [收藏(0)] [報告]
發(fā)表于 2010-09-09 20:10 |只看該作者 |倒序瀏覽
下面的是服務器端的監(jiān)聽程序:
GError* error = NULL;
  int sock,s;
  BIO *sbio, *bbio, *acpt;
  SSL_CTX *ctx;
  SSL *ssl;

  /* Build our SSL context*/
  ctx=initialize_ctx("./cert/servercert.pem",
                "./cert/serverkey.pem",PASSWORD);
  // load_dh_params(ctx,DHFILE);

     sbio = BIO_new_ssl (ctx,0);
     BIO_get_ssl(sbio, &ssl);
     if (!ssl)
     {
           g_printerr("Can't locate SSL pointer\n");
           return -1;
     }
      /* Don't want any retries */
     SSL_set_mode (ssl, SSL_MODE_AUTO_RETRY);
     /* Create the buffering BIO */
     bbio = BIO_new (BIO_f_buffer ());
     /* Add to chain */
     sbio = BIO_push (bbio, sbio);
     gchar* port = g_strdup_printf ("%d", listen_port);
     acpt=BIO_new_accept (port);
     g_free (port);
     
     /* By doing this when a new connection is established
     * we automatically have sbio inserted into it. The
     * BIO chain is now 'swallowed' by the accept BIO and
     * will be freed when the accept BIO is freed.
     */
     BIO_set_accept_bios (acpt,sbio);
//      BIO_set_accept_port(acpt, "*:54999");
     /* Setup accept BIO */
     if (BIO_do_accept (acpt) <= 0)
     {
           fprintf(stderr, "Error setting up accept BIO\n");
           ERR_print_errors_fp(stderr);
           return -1;
     }
     
     while (1)
     {
           /* Now wait for incoming connection */
           if (BIO_do_accept (acpt) <= 0)
           {
                 fprintf(stderr, "Error in connection\n");
                 ERR_print_errors_fp(stderr);
                 return -1;
           }
           BIO * c_sbio = BIO_pop (acpt); /* c_sbio may be is the childe of sbio ??*/
           if( !g_thread_create((GThreadFunc)minp_response, c_sbio, FALSE, &error) )
           {
                 g_printerr("協(xié)議分析線程\n");
           }      
  }
  BIO_free_all (acpt);
  SSL_CTX_free (ctx);
  g_thread_exit(0);
這上面是用BIO改后的程序,原來用的是SSL?蛻舳四苓B原來的,但是改后就不能連了!熬芙^連接”。
我想問題可能是上面服務器端的問題。我用 netstat -tlp ,查看到,服務器端正在監(jiān)聽端口,本地地址是"localhost:4999",請各位大俠幫忙看看,有什么問題
[此貼被hecate_eos在2010-09-9 3:50 PM重新編輯]
您需要登錄后才可以回帖 登錄 | 注冊

本版積分規(guī)則 發(fā)表回復

  

北京盛拓優(yōu)訊信息技術有限公司. 版權所有 京ICP備16024965號-6 北京市公安局海淀分局網(wǎng)監(jiān)中心備案編號:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年舉報專區(qū)
中國互聯(lián)網(wǎng)協(xié)會會員  聯(lián)系我們:huangweiwei@itpub.net
感謝所有關心和支持過ChinaUnix的朋友們 轉載本站內容請注明原作者名及出處

清除 Cookies - ChinaUnix - Archiver - WAP - TOP