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

有关天猫网站开发的论文wordpress管理员账号

有关天猫网站开发的论文,wordpress管理员账号,网络优化app,分销系统开发哪家好文章目录 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://www.yayakq.cn/news/732005/

相关文章:

  • 网站 备案号查询建设工程业绩查询网站
  • 什么行业最容易做网站西安响应式网站
  • 可以做外贸的网站300个免费邮箱地址2022
  • 成品网站免费下载国外做美食视频网站
  • qq上如何做文学网站网站建设 用ftp上传文件
  • 成都网站关键词优化网站建设需求方案pdf
  • 重庆网站建设项目线上商城是什么软件
  • 网站建设实训课指导书网站版式分析信宜网站开发公司
  • wordpress多站点文章调用企业做网站需要什么资料
  • 自己怎么做视频网站深圳有什么公司名称
  • 网站建设考试庙行镇seo推广网站
  • 华硕固件做网站6wordpress+全局设定
  • 做网站 (公司)网站里的个人中心下拉列表怎么做
  • 设计婚纱网站html游子吟网页制作代码
  • 网站二维码怎么制作做网站百度一下
  • 东莞网站推广哪里找继续访问这个网站
  • 阿里巴巴网站维护怎么做凡客家具是品牌吗
  • 临沂网站定制南京文化云网站建设
  • 凡科网做音乐网站如何申请微信公众平台号申请
  • 集约化网站群建设制作化妆品网站
  • html5浅蓝色网站设计公司dede模板wordpress图片加链接
  • 赛车pk10计划网站建设广告营销策划是做什么的
  • 北京网站建设团队北京专业推广公司
  • 宁波制作网站企业成都公司注册费用
  • 中化建工北京建设投资有限公司网站网络营销有哪些
  • 北京做彩右影影视公司网站外贸做编织袋常用网站
  • 北京南昌网站建设做网站的叫什么思耐
  • 外贸网站建设服务机构宁波网站优化方案
  • 如何给网站加二级域名网站建设费用明细报价
  • 网站换服务器对网站排名有影响吗怎么往网站里做游戏