国产人妻人伦精品_欧美一区二区三区图_亚洲欧洲久久_日韩美女av在线免费观看

合肥生活安徽新聞合肥交通合肥房產(chǎn)生活服務(wù)合肥教育合肥招聘合肥旅游文化藝術(shù)合肥美食合肥地圖合肥社保合肥醫(yī)院企業(yè)服務(wù)合肥法律

self-signed certificate.代做、代寫Java/c++設(shè)計(jì)編程

時(shí)間:2024-02-25  來(lái)源:合肥網(wǎng)hfw.cc  作者:hfw.cc 我要糾錯(cuò)



Step #2: Create a self-signed certificate. HTTPS connections require TLS, and, in order to use TLS, your
server will need a certificate. For testing, you may want to create a self-signed certificate. You can do this
using the keytool utility, with is included in the JDK. An example command would be (on a single line):
keytool -genkeypair -keyalg RSA -alias selfsigned -keystore keystore.jks
-storepass secret -dname "CN=Blah, OU=Blubb, O=Foo, L=Bar, C=US"
This will create a file called keystore.jks in the local directory.
Step #3: Open a TLS socket. As a first step, implement the securePort method, and then add code to
replace the existing server socket with a TLS server socket. You can use code roughly like the following:
import javax.net.ssl.*;
import java.security.*;
String pwd = "secret";
KeyStore keyStore = KeyStore.getInstance("JKS");
keyStore.load(new FileInputStream("keystore.jks"), pwd.toCharArray());
KeyManagerFactory keyManagerFactory = KeyManagerFactory.getInstance("SunX509");
keyManagerFactory.init(keyStore, pwd.toCharArray());
SSLContext sslContext = SSLContext.getInstance("TLS");
sslContext.init(keyManagerFactory.getKeyManagers(), null, null);
ServerSocketFactory factory = sslContext.getServerSocketFactory();
ServerSocket serverSocketTLS = factory.createServerSocket(securePortNo);
You should now be able to use serverSocketTLS instead of your existing server socket. (This will
disable normal HTTP requests for now, but we’ll fix this shortly.) Try running a simple test application on
your server, like
securePort(8443);
get("/", (req,res) -> { return "Hello World!"; });
and then open https://localhost:8443/ in your web browser. (Be sure to include the https
part!) If you are using the self-signed certificate from Step #2, which is not signed by any CA, you will see
lots of warnings in the browser, but it should be possible to override them. For instance, in Safari you would
see a warning that says that “This Connection Is Not Private”, but you can click on “Details”, then on “visit
this website”, and then confirm by clicking on the “Visit Website” button. At the end, you should see the
“Hello World!” message from the test application, and you should be able to view the information in your
self-signed certificate by clicking on the little lock icon in Safari’s address bar (or whatever equivalent your
favorite browser has to this). If the lock icon is missing or you do not get any warnings, something is
wrong; chances are that you are still using HTTP. Also, at this point, the https test case should pass.
Step #4: Add back HTTP support. In order to support both HTTP and HTTPS, which use different ports,
your server will need to listen to two different server sockets. A simple way to do that is to use two
separate threads. If you haven’t already, you should factor out your server loop into a separate method, say
serverLoop(s), where s is a ServerSocket; at that point, you can simply open both a normal
server socket and a TLS server socket, and then launch two separate threads that each invoke this method
with one of the two server sockets. At this point, both the http and https test cases should pass.
Step #5: Add a session object. Next, create a class – perhaps called SessionImpl – that implements
the Session interface. This class doesn’t have to do much; all it needs to do is store the various bits of
information (the session ID, creation time and last-accessed time, max active interval, and key-value pairs)
and implement the various getter and setter methods in the interface.
Step #6: Add session handling. Now you can use this class to add support for sessions. There are four
places in the server that need changes. First, you need a data structure that stores the sessions by session ID
– probably some kind of Map. Second, you’ll need to parse the Cookie header(s) while reading the
3
request, and extract the cookie with the name SessionID, if it exists; if it does, and your Map contains a
session for that ID, update that session’s last-accessed time and make sure that the session() method
will return it when called. Third, when session() is called and there is not already a session, you’ll
need to create a new object with a fresh session ID. Keep in mind that the session ID should be random and
have at least 120 bits; for instance, you can pick a set of 64 characters (maybe lower and upper case letters,
digits, and two other characters) and then draw 20 of them. Finally, when writing out the headers, you’ll
need to add a Set-Cookie header whenever you’ve created a new SessionImpl object, to send back
the corresponding SessionID cookie to the user. With this, you should be able to implement the two
attribute methods from the Session interface, and both the sessionid and permanent test
cases should pass.
Step #7: Add session expiration. The final step is to add a way to expire session objects. This requires
two steps. First, you’ll need a way to periodically expire old sessions that have not been accessed recently;
you can do this by launching another thread that sleeps for a few seconds, removes any session objects
whose last-accessed timestamp is too old, and then repeats. Notice, however, that this could cause the
server to slightly overshoot the lifetime of a session. To fix that, the second step is to also check the
last-accessed timestamp before updating it, and to simply ignore the object if it has already expired but has
not been deleted yet. At this point, both the expire test case should pass.
Step #8: Implement a test server. Write a little server that 1) calls securePort(443) to set the
HTTPS port, and 2) defines a GET route for / that returns the required message from Section 2. Test this
server locally (https://localhost/) with your self-signed certificate, to make sure that it displays
the message correctly. If you cannot bind to port 443 on your local machine, you can use port 8443 for
testing (in this case, open https://localhost:8443/ instead), but please don’t forget to use 443 in
the final version that will be deployed on EC2.
Step #9: Launch an EC2 instance. Log into the Amazon Web Services console and choose EC2 (by
clicking on “Services”, then on “Compute”, and then on “EC2”). Click on “Launch Instance”, and then do
the following:
• Under “Application and OS Images”, choose the default Amazon Linux AMI (Amazon Linux 2023).
• Under “Instance type”, choose one of the smallest/cheapest instances – say, a t2.micro instance.
This should be enough for our purposes.
• Under “Key Pair”, click on “Create new key pair”, choose a descriptive name (perhaps “CIS5550”),
and pick RSA and the .pem format. Hit “Create Key Pair”, which should cause your browser to
download a .pem file.
• Under “Network settings”, make sure that the following three options are checked: “Allow SSH
traffic from Anywhere”, “Allow HTTPS traffic from the internet”, and “Allow HTTP traffic from the
internet”. Please double-check this – if you get this step wrong, chances are that you won’t be able to
connect to your server later on.
• Under “Configure storage”, you can keep the default, which is probably an 8GB gp3 root volume.
In the summary bar on the right, double-check that the number of instances is 1, and then hit the orange
“Launch instance” button. Wait a moment, until (hopefully) AWS reports success. Go back to the
“Instances” tab in EC2, and find the instance you just launched. When you click on its instance ID, you
should see an “Instance summary” that shows, among lots of other things, its public IPv4 address. Write
this down. (Do not confuse this with the private IPv4 address, which probably starts with 172. or 10.
請(qǐng)加QQ:99515681  郵箱:99515681@qq.com   WX:codehelp 

掃一掃在手機(jī)打開當(dāng)前頁(yè)
  • 上一篇:CMSC 323代做、代寫Java, Python編程
  • 下一篇:代做Project 1: 3D printer materials estimation
  • 無(wú)相關(guān)信息
    合肥生活資訊

    合肥圖文信息
    流體仿真外包多少錢_專業(yè)CFD分析代做_友商科技CAE仿真
    流體仿真外包多少錢_專業(yè)CFD分析代做_友商科
    CAE仿真分析代做公司 CFD流體仿真服務(wù) 管路流場(chǎng)仿真外包
    CAE仿真分析代做公司 CFD流體仿真服務(wù) 管路
    流體CFD仿真分析_代做咨詢服務(wù)_Fluent 仿真技術(shù)服務(wù)
    流體CFD仿真分析_代做咨詢服務(wù)_Fluent 仿真
    結(jié)構(gòu)仿真分析服務(wù)_CAE代做咨詢外包_剛強(qiáng)度疲勞振動(dòng)
    結(jié)構(gòu)仿真分析服務(wù)_CAE代做咨詢外包_剛強(qiáng)度疲
    流體cfd仿真分析服務(wù) 7類仿真分析代做服務(wù)40個(gè)行業(yè)
    流體cfd仿真分析服務(wù) 7類仿真分析代做服務(wù)4
    超全面的拼多多電商運(yùn)營(yíng)技巧,多多開團(tuán)助手,多多出評(píng)軟件徽y1698861
    超全面的拼多多電商運(yùn)營(yíng)技巧,多多開團(tuán)助手
    CAE有限元仿真分析團(tuán)隊(duì),2026仿真代做咨詢服務(wù)平臺(tái)
    CAE有限元仿真分析團(tuán)隊(duì),2026仿真代做咨詢服
    釘釘簽到打卡位置修改神器,2026怎么修改定位在范圍內(nèi)
    釘釘簽到打卡位置修改神器,2026怎么修改定
  • 短信驗(yàn)證碼 寵物飼養(yǎng) 十大衛(wèi)浴品牌排行 suno 豆包網(wǎng)頁(yè)版入口 wps 目錄網(wǎng) 排行網(wǎng)

    關(guān)于我們 | 打賞支持 | 廣告服務(wù) | 聯(lián)系我們 | 網(wǎng)站地圖 | 免責(zé)聲明 | 幫助中心 | 友情鏈接 |

    Copyright © 2025 hfw.cc Inc. All Rights Reserved. 合肥網(wǎng) 版權(quán)所有
    ICP備06013414號(hào)-3 公安備 42010502001045

    国产人妻人伦精品_欧美一区二区三区图_亚洲欧洲久久_日韩美女av在线免费观看
    蜜桃传媒视频第一区入口在线看 | 日本欧洲国产一区二区| 日韩精品手机在线观看| 91精品久久久久久久久中文字幕| 国产精品毛片a∨一区二区三区|国| 色噜噜狠狠一区二区三区| 成人精品久久一区二区三区 | 国产精品户外野外| 欧美日韩精品免费观看视一区二区| 91久久国产精品| 在线观看污视频| 国产女主播自拍| 久久天天躁狠狠躁夜夜躁2014 | 欧美日韩无遮挡| 国产成一区二区| 亚洲国产欧美日韩| 国产精品一区二区三区免费视频| 操人视频在线观看欧美| 僵尸世界大战2 在线播放| 九色91国产| 日韩欧美在线播放视频| 久久综合毛片| 大波视频国产精品久久| 91国内精品久久| 成人做爰www免费看视频网站| 成人在线免费观看一区| 国产aⅴ精品一区二区三区黄| 国产专区一区二区| 欧美成人在线免费| 国产欧美日韩网站| 色综合久久久久久中文网| 国精产品一区一区三区有限在线| 国产精品久久久久久久久久99| 韩国一区二区av| 久久精品国产一区| 精品日韩美女| 欧美精品激情在线| 97精品在线观看| 日日噜噜噜噜夜夜爽亚洲精品| 久久伊人一区| 五月天婷亚洲天综合网鲁鲁鲁| 久久久婷婷一区二区三区不卡| 色视频一区二区三区| 久久久久久久网站| 好吊色欧美一区二区三区| 欧美精品性视频| 国产精品.com| 国产精品人成电影| 亚洲va久久久噜噜噜久久狠狠| 国产亚洲精品自在久久| 最新中文字幕久久| 97久久精品在线| 欧美伊久线香蕉线新在线| 国产精品丝袜久久久久久不卡 | 久久国产精品亚洲va麻豆| 欧美中日韩免费视频| 国产精品国产亚洲精品看不卡 | 欧洲精品一区二区三区久久| 国产精品激情av电影在线观看| 豆国产97在线| 日韩人妻精品一区二区三区| 国产精品久久亚洲| 91久久国产综合久久91精品网站| 欧美专区一二三| 欧美精品九九久久| 久久久精品一区| 国产精品稀缺呦系列在线| 日本一区二区免费高清视频| 国产精品久久九九| 91精品网站| 黄网站欧美内射| 亚洲一区二区三区sesese| 日韩中文字幕在线看| 国产日韩三区| 日本精品久久电影| 色综合久久精品亚洲国产| 国产成人一区二区| 国产欧洲精品视频| 欧洲熟妇精品视频| 亚洲欧美综合一区| 国产精品美女av| 国产xxxx振车| 国产精品自在线| 欧美性视频在线| 亚洲免费在线精品一区| 欧美久久久精品| 久久久噜噜噜久噜久久| 国产精品一二区| 黄色91av| 人人做人人澡人人爽欧美| 日韩人妻一区二区三区蜜桃视频| 欧美乱妇高清无乱码| 国产a级片免费观看| 超碰在线观看97| 狠狠色噜噜狠狠色综合久| 日本精品久久久久久久久久| 亚洲欧洲免费无码| 中文字幕第一页亚洲| 国产精品成人观看视频免费| 久久久精品影院| 视频直播国产精品| 久久男人资源站| 91精品国产高清久久久久久91裸体| 国产色一区二区三区| 黄色一级片国产| 欧美一区激情视频在线观看| 亚洲影院在线看| 精品国产乱码久久久久久蜜柚 | 国产精品吹潮在线观看| 少妇精69xxtheporn| 国产av无码专区亚洲精品| 91精品国产乱码久久久久久蜜臀 | 日本中文字幕久久看| 国产色一区二区三区| 欧美连裤袜在线视频| 日本高清一区| 日韩在线综合网| 午夜啪啪福利视频| 国产精品免费观看高清| 国产精品日韩三级| 久久精品视频99| 国产精品日韩一区二区| 国产精品我不卡| 久久精品久久久久| 久久精品99国产精品酒店日本| 日韩在线视频网站| 国产成人精品a视频一区www| 久久久免费观看| 久热国产精品视频一区二区三区| 91精品久久久久久| 久久精品香蕉视频| 久久国产精品久久精品国产| 国产成人+综合亚洲+天堂| 久久久久国产精品视频| 国产福利久久| 日韩最新在线视频| 久久久999国产| 久久福利视频网| 中文字幕久久一区| 午夜精品在线视频| 日产精品久久久一区二区| 手机在线观看国产精品| 日韩精品久久久毛片一区二区| 品久久久久久久久久96高清| 欧美国产综合在线| 精品视频在线观看一区| 国产精品直播网红| 国产精品91在线| 日韩亚洲一区二区| 国产精品露脸av在线| 欧美激情一级精品国产| 亚洲欧洲精品一区二区| 日韩免费高清在线| 免费亚洲一区二区| 成人免费观看a| 国产suv精品一区二区三区88区| 日韩中文av在线| 久久成人av网站| 亚洲a成v人在线观看| 三级三级久久三级久久18| 欧美在线一区二区视频| 国产主播一区二区三区四区| 97免费高清电视剧观看| 日韩中文字幕免费看| 久久综合国产精品台湾中文娱乐网| 亚洲在线色站| 欧美区在线播放| 日本久久久久久久久| 蜜桃视频日韩| 91国内在线视频| 国产精品久久久久福利| 亚洲欧美日韩精品综合在线观看 | 国产美女无遮挡网站| 国产精品18久久久久久麻辣| 精品国偷自产在线| 久久91精品国产91久久跳| 日本一级淫片演员| 免费精品视频一区二区三区| 91国内在线视频| 国产精品极品美女粉嫩高清在线| 日韩尤物视频| 国产日韩欧美中文| 久久久久一本一区二区青青蜜月| 欧美xxxx18国产| 欧美视频免费播放| 7777在线视频| 九九热r在线视频精品| 日韩美女在线观看一区| 成人国产精品av| 国产精品日韩电影| 日韩av三级在线| www黄色日本| 国产精品免费一区二区| 日韩中文字幕在线视频观看| 国产免费黄色av| 国产精品美乳一区二区免费| 婷婷亚洲婷婷综合色香五月| 国产毛片久久久久久国产毛片| zzijzzij亚洲日本成熟少妇| 亚洲a级在线观看|