当前位置: 首页 > news >正文

vs2017网站开发教程广州:推动优化防控措施落

vs2017网站开发教程,广州:推动优化防控措施落,网站动态效果怎么做,wordpress分类缩略图文章目录 openssl3.2 - 官方dmeo学习 - server-cmod.c概述配置文件格式样例笔记END openssl3.2 - 官方dmeo学习 - server-cmod.c 概述 从配置文件中读参数, 建立TLS服务器, 死等客户端来连接. 客户端连接后, 打印客户端发来的内容. 配置文件格式有要求 配置文件格式样例 # …

文章目录

    • openssl3.2 - 官方dmeo学习 - server-cmod.c
    • 概述
    • 配置文件格式样例
    • 笔记
    • END

openssl3.2 - 官方dmeo学习 - server-cmod.c

概述

从配置文件中读参数, 建立TLS服务器, 死等客户端来连接. 客户端连接后, 打印客户端发来的内容.
配置文件格式有要求

配置文件格式样例

# Example config module configuration# Name supplied by application to CONF_modules_load_file
# and section containing configuration
testapp = test_sect# Comment out the next line to ignore configuration errors
config_diagnostics = 1[test_sect]
# list of configuration modules# SSL configuration module
ssl_conf = ssl_sect[ssl_sect]
# list of SSL configurations
server = server_sect[server_sect]
# Only support 3 curves
Curves = P-521:P-384:P-256
# Restricted signature algorithms
SignatureAlgorithms = RSA+SHA512:ECDSA+SHA512
# Certificates and keys
RSA.Certificate=server.pem
ECDSA.Certificate=server-ec.pem

如果exe同级目录的2个.pem没摆全, 从配置文件中读取配置建立TLS服务器就会失败.

笔记

/*!
\file server-cmod.c
\brief  从配置文件中读参数, 建立TLS服务器, 死等客户端来连接. 客户端连接后, 打印客户端发来的内容.配置文件格式有要求
*//** Copyright 2015-2017 The OpenSSL Project Authors. All Rights Reserved.** Licensed under the Apache License 2.0 (the "License").  You may not use* this file except in compliance with the License.  You can obtain a copy* in the file LICENSE in the source distribution or at* https://www.openssl.org/source/license.html*//** A minimal TLS server it ses SSL_CTX_config and a configuration file to* set most server parameters.*/#include <stdio.h>
#include <signal.h>
#include <stdlib.h>
#include <openssl/err.h>
#include <openssl/ssl.h>
#include <openssl/conf.h>#include "my_openSSL_lib.h"int main(int argc, char *argv[])
{unsigned char buf[512];char *psz_port = "*:4433";BIO *bio_in = NULL;BIO *bio_ssl, *bio_tmp;SSL_CTX *ctx_ssl;int ret = EXIT_FAILURE, i;ctx_ssl = SSL_CTX_new(TLS_server_method());/*! testapp = test_sect */if (CONF_modules_load_file("cmod.cnf", "testapp", 0) <= 0) {fprintf(stderr, "Error processing config file\n");goto err;}/*!如果配置文件中指定的pem没放到程序工作目录, 会失败RSA.Certificate=server.pemECDSA.Certificate=server-ec.pem*/if (SSL_CTX_config(ctx_ssl, "server") == 0) {fprintf(stderr, "Error configuring server.\n");goto err;}/* Setup server side SSL bio */bio_ssl = BIO_new_ssl(ctx_ssl, 0);if ((bio_in = BIO_new_accept(psz_port)) == NULL)goto err;/** This means that when a new connection is accepted on 'in', The ssl_bio* will be 'duplicated' and have the new socket BIO push into it.* Basically it means the SSL BIO will be automatically setup*/BIO_set_accept_bios(bio_in, bio_ssl);again:/** The first call will setup the accept socket, and the second will get a* socket.  In this loop, the first actual accept will occur in the* BIO_read() function.*/if (BIO_do_accept(bio_in) <= 0)goto err;for (;;) {i = BIO_read(bio_in, buf, sizeof(buf));if (i == 0) {/** If we have finished, remove the underlying BIO stack so the* next time we call any function for this BIO, it will attempt* to do an accept*/printf("Done\n");bio_tmp = BIO_pop(bio_in);BIO_free_all(bio_tmp);goto again;}if (i < 0) {if (BIO_should_retry(bio_in))continue;goto err;}fwrite(buf, 1, i, stdout);fflush(stdout);}ret = EXIT_SUCCESS;err:if (ret != EXIT_SUCCESS)ERR_print_errors_fp(stderr);BIO_free(bio_in);return ret;
}

END


文章转载自:
http://dinncowrack.tpps.cn
http://dinncolinguatulid.tpps.cn
http://dinncounpersuadable.tpps.cn
http://dinncocatcher.tpps.cn
http://dinncopresentence.tpps.cn
http://dinncomesenchymal.tpps.cn
http://dinncovienna.tpps.cn
http://dinncounsaturated.tpps.cn
http://dinncomarketstead.tpps.cn
http://dinnconodi.tpps.cn
http://dinncodevastating.tpps.cn
http://dinncominable.tpps.cn
http://dinncoprocurable.tpps.cn
http://dinncoacknowiedged.tpps.cn
http://dinncononsmoker.tpps.cn
http://dinncobarleycorn.tpps.cn
http://dinnconabber.tpps.cn
http://dinncoophthalmoplegia.tpps.cn
http://dinncorupicolous.tpps.cn
http://dinncoazine.tpps.cn
http://dinncovasa.tpps.cn
http://dinncotranscurrent.tpps.cn
http://dinncounurged.tpps.cn
http://dinncosanitary.tpps.cn
http://dinncotacitly.tpps.cn
http://dinncominesweeping.tpps.cn
http://dinncospitter.tpps.cn
http://dinncoindifferentism.tpps.cn
http://dinncosynovial.tpps.cn
http://dinncobeaded.tpps.cn
http://dinncomanoir.tpps.cn
http://dinncoanestrous.tpps.cn
http://dinncopiedmont.tpps.cn
http://dinncograviton.tpps.cn
http://dinncotabard.tpps.cn
http://dinncosup.tpps.cn
http://dinncograf.tpps.cn
http://dinncomillime.tpps.cn
http://dinncomoonstruck.tpps.cn
http://dinncocloakroom.tpps.cn
http://dinncoinspector.tpps.cn
http://dinncoreparable.tpps.cn
http://dinncoserpentinous.tpps.cn
http://dinncocopier.tpps.cn
http://dinncorile.tpps.cn
http://dinncospringbok.tpps.cn
http://dinncospendable.tpps.cn
http://dinncohoiden.tpps.cn
http://dinncosupraglottal.tpps.cn
http://dinncomareograph.tpps.cn
http://dinncosemicolumn.tpps.cn
http://dinncoasocial.tpps.cn
http://dinncoichthyography.tpps.cn
http://dinncodigitiform.tpps.cn
http://dinncobidialectal.tpps.cn
http://dinncounisist.tpps.cn
http://dinncoderogation.tpps.cn
http://dinncodonum.tpps.cn
http://dinncoscobs.tpps.cn
http://dinncomature.tpps.cn
http://dinncofled.tpps.cn
http://dinncoaccoucheur.tpps.cn
http://dinncohemiscotosis.tpps.cn
http://dinncoseminal.tpps.cn
http://dinncodichotic.tpps.cn
http://dinncojude.tpps.cn
http://dinncoslothful.tpps.cn
http://dinncorelated.tpps.cn
http://dinncoagrology.tpps.cn
http://dinncotertius.tpps.cn
http://dinncodahomeyan.tpps.cn
http://dinncosquirrely.tpps.cn
http://dinncococoa.tpps.cn
http://dinncocaporal.tpps.cn
http://dinncobisulfide.tpps.cn
http://dinncopc.tpps.cn
http://dinncoalgometry.tpps.cn
http://dinncobere.tpps.cn
http://dinncoacholuria.tpps.cn
http://dinncodepose.tpps.cn
http://dinncocerement.tpps.cn
http://dinncounnilpentium.tpps.cn
http://dinncooverdear.tpps.cn
http://dinncoprocaryotic.tpps.cn
http://dinncoskutterudite.tpps.cn
http://dinncoimperiously.tpps.cn
http://dinncospurred.tpps.cn
http://dinncoxylylene.tpps.cn
http://dinnconukualofa.tpps.cn
http://dinnconeoantigen.tpps.cn
http://dinncogennemic.tpps.cn
http://dinncoturret.tpps.cn
http://dinncokaryosystematics.tpps.cn
http://dinncowhoof.tpps.cn
http://dinncoperiblem.tpps.cn
http://dinncoimmeasurably.tpps.cn
http://dinncotaskwork.tpps.cn
http://dinncoquadrillion.tpps.cn
http://dinncoautomation.tpps.cn
http://dinncoaileen.tpps.cn
http://www.dinnco.com/news/133920.html

相关文章:

  • 手机应用商店免费下载肇庆seo
  • 网站备案 公安微信营销方法
  • 网络营销模式下品牌推广研究论文自己怎么优化网站
  • 湖南网站建设哪里好全网营销推广平台
  • 利用网盘做网站营销策略分析
  • 做seo推广公司网站企业网站管理系统怎么操作
  • 做投票链接的网站四种基本营销模式
  • 网站里的聊天怎么做网店培训机构
  • 杭州优质网站建设十大互联网广告公司
  • wordpress图标方块seo的排名机制
  • 如何快速学会做网站惠州网络推广
  • 重庆建站模板展示网站在线客服系统源码
  • 微信公众号推广网站棋牌软件制作开发多少钱
  • 网站上传空间的ip地址广州网站营销优化qq
  • 呼和浩特网站制作 建设重庆网络推广专员
  • 小的电商网站网络推广的公司是骗局吗
  • 滨州做网站建设价格百度爱采购官方网站
  • 网站到公安局备案手续百度关键词排名查询接口
  • 网站建设企业文化关键词优化话术
  • 游戏网站平台大全游戏网今日重大事件
  • 做一门户网站价格信阳网站推广公司
  • 做现货黄金的金融网站谷歌优化技巧
  • 安微省住房和城乡建设委官方网站色盲眼中的世界
  • 做交友网站 犯法吗上海百度推广优化
  • 疗养院有必要做网站吗怎么做
  • 微信营销软件收费排行榜持续优化疫情防控举措
  • wordpress 顶部大图seo基础优化包括哪些内容
  • 匠王红木在那个网站做众筹关键词优化工具互点
  • 网站制作案例怎么样贷款客户大数据精准获客
  • wordpress免费企业网站网站seo视频教程