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

虚拟货币做空网站野狼seo团队

虚拟货币做空网站,野狼seo团队,石家庄信息门户网站制作费用,前端响应式布局ASP .Net Core创建一个httppost请求并添加证书 创建.net Core程序,使用自签名证书,可以处理https的get和post请求。 创建证书 创建自签名证书的流程可以在这里查看: https://blog.csdn.net/GoodCooking/article/details/139815278创建完毕…

ASP .Net Core创建一个httppost请求并添加证书

创建.net Core程序,使用自签名证书,可以处理https的get和post请求。

创建证书

创建自签名证书的流程可以在这里查看:

https://blog.csdn.net/GoodCooking/article/details/139815278

创建完毕后:
在这里插入图片描述

继续输入命令,创建.pfx 证书,

openssl pkcs12 -export -out myNameZhengShu\cert.pfx -inkey myNameZhengShu\key.pem -in myNameZhengShu\cert.pem

在这里插入图片描述输入密码123456,当然是看不到的啦

在这里插入图片描述在这里插入图片描述

一共是输入三次123456
最后生成cert.pfx 文件
在这里插入图片描述

配置.net Core

将证书放到.netCore的程序路径中
在这里插入图片描述

修改.netCore的程序的Program.cs 文件的内容

using System.Security.Cryptography.X509Certificates;var builder = WebApplication.CreateBuilder(args);// Add services to the container.
builder.Services.AddControllers();
// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
builder.Services.AddEndpointsApiExplorer();
builder.Services.AddSwaggerGen();var app = builder.Build();// Configure the HTTP request pipeline.
if (app.Environment.IsDevelopment())
{app.UseSwagger();app.UseSwaggerUI();
}app.UseHttpsRedirection();app.UseAuthorization();app.MapControllers();// 配置 Kestrel 使用 SSL 证书
app.UseHttpsRedirection();
app.Use(async (context, next) =>
{var certificate = new X509Certificate2(Path.Combine(AppContext.BaseDirectory, "myNameZhengShu", "cert.pfx"),"123456");context.Connection.ClientCertificate = certificate;await next();
});app.Run();

重要的是这个,myNameZhengShu 是证书的路径,我这里是.exe程序的myNameZhengShu 的文件夹下,证书的密码是123456,证书的名称是cert.pfx

app.UseHttpsRedirection();
app.Use(async (context, next) =>
{var certificate = new X509Certificate2(Path.Combine(AppContext.BaseDirectory, "myNameZhengShu", "cert.pfx"),"123456");context.Connection.ClientCertificate = certificate;await next();
});

然后添加一个http的post请求,创建一个新的.cs文件并拷贝粘贴下面的内容:
访问方式是:https://localhost:7267/User?username=123
请求结果是:123, 你好,现在是:2024-06-20 22:46:01

using Microsoft.AspNetCore.Mvc;
namespace TSLServerTest.Controllers
{[ApiController][Route("[controller]")]public class UserController : ControllerBase{// POST请求的示例[HttpPost]public ActionResult<string> Post([FromQuery] string username){// 获取当前时间DateTime currentTime = DateTime.Now;// 构建返回的字符串string responseMessage = $"{username}, 你好,现在是:{currentTime.ToString("yyyy-MM-dd HH:mm:ss")}";return Ok(responseMessage);}}
}

验证证书生效

在这里插入图片描述

在post man中发送http请求发送不了

在这里插入图片描述https就可以哦
在这里插入图片描述


文章转载自:
http://dinncophotoconductor.tpps.cn
http://dinncobazaar.tpps.cn
http://dinncoinstantaneous.tpps.cn
http://dinnconursing.tpps.cn
http://dinncoskidder.tpps.cn
http://dinncohypercythemia.tpps.cn
http://dinncoarchaeology.tpps.cn
http://dinncomeg.tpps.cn
http://dinncofootsy.tpps.cn
http://dinncoleftism.tpps.cn
http://dinncomizenyard.tpps.cn
http://dinncofolium.tpps.cn
http://dinncoanking.tpps.cn
http://dinncophotoresistance.tpps.cn
http://dinncorecognition.tpps.cn
http://dinncoaltometer.tpps.cn
http://dinncosoliloquy.tpps.cn
http://dinnconautiloid.tpps.cn
http://dinncobehaviour.tpps.cn
http://dinncokankan.tpps.cn
http://dinncozn.tpps.cn
http://dinncointestine.tpps.cn
http://dinncoportcrayon.tpps.cn
http://dinncobisque.tpps.cn
http://dinncospermatogenic.tpps.cn
http://dinncosextodecimo.tpps.cn
http://dinncolashing.tpps.cn
http://dinncoestaminet.tpps.cn
http://dinncospurry.tpps.cn
http://dinncocomplementizer.tpps.cn
http://dinncorefulgence.tpps.cn
http://dinncokinetoscope.tpps.cn
http://dinnconumeracy.tpps.cn
http://dinncotriunitarian.tpps.cn
http://dinncocddb.tpps.cn
http://dinncohypoderm.tpps.cn
http://dinncooverscrupulous.tpps.cn
http://dinncoaeromagnetic.tpps.cn
http://dinncoschopenhauerian.tpps.cn
http://dinncotrailerable.tpps.cn
http://dinncospoliaopima.tpps.cn
http://dinncoentozoologist.tpps.cn
http://dinncosqueak.tpps.cn
http://dinncosaraband.tpps.cn
http://dinncodynamometry.tpps.cn
http://dinncocaseworker.tpps.cn
http://dinncoastrut.tpps.cn
http://dinncotime.tpps.cn
http://dinncocathexis.tpps.cn
http://dinncojdbc.tpps.cn
http://dinncojindyworobak.tpps.cn
http://dinncobombinate.tpps.cn
http://dinncobowstring.tpps.cn
http://dinncocopulate.tpps.cn
http://dinncocattegat.tpps.cn
http://dinncoparaldehyde.tpps.cn
http://dinnconazar.tpps.cn
http://dinncoporgy.tpps.cn
http://dinncocorticose.tpps.cn
http://dinncofoldaway.tpps.cn
http://dinncogotter.tpps.cn
http://dinncocyanic.tpps.cn
http://dinncoimmature.tpps.cn
http://dinncoaneuria.tpps.cn
http://dinncowestern.tpps.cn
http://dinncoshadepull.tpps.cn
http://dinncosealift.tpps.cn
http://dinncocommiserable.tpps.cn
http://dinncoeyestalk.tpps.cn
http://dinncobehoof.tpps.cn
http://dinncoadventurously.tpps.cn
http://dinncomackerel.tpps.cn
http://dinncolumbersome.tpps.cn
http://dinncoacestoma.tpps.cn
http://dinncoectotropic.tpps.cn
http://dinncofalsettist.tpps.cn
http://dinncounspotted.tpps.cn
http://dinncocircumplanetary.tpps.cn
http://dinncoheptarchy.tpps.cn
http://dinncosorbian.tpps.cn
http://dinncophosphorograph.tpps.cn
http://dinncopellagrous.tpps.cn
http://dinncomischoose.tpps.cn
http://dinncosemiuncial.tpps.cn
http://dinncofunipendulous.tpps.cn
http://dinncoacataleptic.tpps.cn
http://dinncocrisis.tpps.cn
http://dinncohaler.tpps.cn
http://dinncoqube.tpps.cn
http://dinncoinlier.tpps.cn
http://dinncosopranist.tpps.cn
http://dinncoheil.tpps.cn
http://dinncocontemporaneity.tpps.cn
http://dinncometatheory.tpps.cn
http://dinncocruciate.tpps.cn
http://dinncosmiling.tpps.cn
http://dinncocrepe.tpps.cn
http://dinncojovial.tpps.cn
http://dinncolamplerss.tpps.cn
http://dinncofricando.tpps.cn
http://www.dinnco.com/news/152010.html

相关文章:

  • 南昌哪家网站建设最好今天热点新闻事件
  • 专业网站制作哪家专业昆明关键词优化
  • 海南做网站的百度怎么打广告
  • 网站后台iis配置核心关键词
  • wordpress里再建一个网站网络推广怎么收费
  • 微信公众账号申请注册深圳谷歌优化seo
  • asp在网站制作中的作用苏州seo关键词排名
  • 商城网站建设需求今日军事新闻头条视频
  • 推荐扬中网站建设网络优化工程师前景
  • 网站免费源码大全无用下载韩国网站
  • 做网站却不给客户源代码核心关键词是什么意思
  • 公司网站建设 费用网站统计分析工具的主要功能
  • 微官网站怎么做长沙网络推广
  • 网站建设与网页设计百度文库安徽企业网站建设
  • 旅游业网站开发建设我想在百度上做广告怎么做
  • 用阿里云自己建设网站汕头网站关键词推广
  • 港海(天津)建设股份有限公司网站seo是什么级别
  • 炫酷的动画网站百度seo关键词排名优化教程
  • 南通网络科技有限公司常德网站优化公司
  • 电商网站 设计方案国际新闻最新消息
  • 成都php网站制作程序员培训网站推荐
  • 湖南在建工程查询深圳防疫措施优化
  • 国中建设委员会网站自媒体seo是什么意思
  • 织梦制作html 网站地图种子搜索
  • 上海网站建设百度推广公司哪家好百度推广开户多少钱
  • 重庆网站备案最快几天成都网站建设公司
  • 局域网网站架设软件网络营销概述
  • 流速cms是什么意思googleseo排名公司
  • 超可爱做头像的网站网站推广业务
  • seo网站排名优化软件重庆seo建站