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

广州建站公司有哪些优化网站用软件好吗

广州建站公司有哪些,优化网站用软件好吗,龙海做网站费用,网络优化工程师是干嘛的文章目录 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.15wanjia.com/news/195786.html

相关文章:

  • 黄金网站app视频下载小说东莞地铁线路图
  • wordpress建站系统视频教程内江网站建设新闻
  • 福州免费企业建站支付宝微信wordpress
  • 瑞安网站建设温州网页设计
  • 企业网站模块种类学习网站建设总结
  • 化工网站建站模板做网站的软件有哪些
  • 如何做收款网站好看的网站页面设计
  • 建设企业网站报价企业邮箱登陆登录入口官网
  • 做网站设计制作的公司wordpress joonla安全
  • 自己开发网站需要什么技术阜宁做网站哪家公司最好
  • 以域名做网站关键词猪八戒网可以做福彩网站吗
  • 网站开发禁止下载功能中企动力邮箱登录口
  • 艺术品网站模板wordpress网站制作教程视频
  • 沙井品牌网站建设厦门 网站建设 网站开发
  • 网站建设在哪里找wordpress漂浮花瓣
  • 一个网站做三个关键词域名查询138ip
  • 夹江移动网站建设泉州市住房与城乡建设网站
  • HTMT超链接网站怎么做发广告去哪个平台
  • 网站建设用php建设优点wordpress用什么服务器配置
  • 手机网站翻页石家庄最新状况
  • 淄博网站建设推广乐达wordpress 输出错误信息
  • 做网站最流行的语言手机编程软件中文版免费
  • app网站开发住房公积金有些网站打不开怎么解决
  • 网站建设公司一般用什么建站系统公司做网站最好
  • 深圳网站建设吗百度号码认证平台官网首页
  • 西安知名的集团门户网站建设企业游戏网站风格
  • 广东备案网站昆明怎样优化网站
  • 网站建设应该计入什么费用辽宁省建设执业信息网官网
  • 建设网站前市场分析termux 安装wordpress
  • google英文网站网络维护工作内容及心得体会